2- Fill the cube :-
import math
n=int(input())
l=[]
c=0
for i in range(n):
l.append(list(map(str,input().split())))
for j in range(n):
for k in range(n):
if l[j][k]=='D':
c=c+1
print(math.floor(math.sqrt(c)))
import math
n=int(input())
l=[]
c=0
for i in range(n):
l.append(list(map(str,input().split())))
for j in range(n):
for k in range(n):
if l[j][k]=='D':
c=c+1
print(math.floor(math.sqrt(c)))
please provide in C/C++
ReplyDeletedid you solve it?
Deletecan you please explain why we are square rooting the answer. please explain
ReplyDelete