Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def differentValuesInMultiplicationTable2(n, m):
- Matrix = [[0 for x in range(m)] for y in range(n)]
- for row in range(0,n):
- for col in range(0,m):
- Matrix[row][col]= (row+1)*(col+1)
- return find_diff(list(Matrix))
- def find_diff(matr):
- nested = matr
- flat = [x for sublist in nested for x in sublist]
- return len(list(set(flat)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement