Find The missing number in each row
4
1 2 3 4
2 3 4 1
3 4 1 2
4 1 2 3
If all rows contains 1 to 4 numbers then it is true else false
n = int(input())
for i in range(n):
flag = True
nums = [int(j) for j in input().split()]
for j in range(n):
if j+1 not in nums:
flag = False
break
print(flag)
Comments
Leave a comment