murali
BAN USERimplementation in Python
matrix = [[0, 0, 0, 1 ], [0, 1, 1, 1], [0, 0, 0, 0], [0, 0, 1, 1]]
#method 1
print sum([len(eachArr)-sum(eachArr) for eachArr in matrix])
#method 2
from operator import add
length = len(matrix)
if matrix[length-1][length-1]==0:
print length**2
elif matrix[0][0]==1:
print 0
else:
total=0
for i in range(length-1,-1,-1):
if matrix[i][0]==0:
#total+=(length - sum(matrix[i]))
total+=(length - reduce(add, matrix[i]))
else:
pass
print total
RepDedicated administrative assistant with years of experience managing large and small offices. I have worked with numerous branches,including payroll ...
Replisapyara, abc at 247quickbookshelp
I am motivated and organized professional with proven years of experience in mail services and industry having vast experience as ...
RepJe suis Hudson Will des États-Unis. Je travaille comme technicien dans une entreprise Éco Vannes. J'analyse et vérifie tous ...
- murali July 01, 2016