Coding | Mcqs | Multiple choice questions | Informative | Computer Science | Engineering | Aptitude | Quants | Verbal

INFEED

Coding Challenge March 19

Problem 2 in python language 

  1. n, m = map(int, input().split())
  2. a = [input() for i in range(n)]
  3.  
  4. ans = ''
  5. for i in range(n):
  6. for j in range(m):
  7. if a[i].count(a[i][j]) == 1 and ''.join(a[k][j] for k in range(n)).count(a[i][j]) == 1:
  8. ans += a[i][j]
  9.  
  10. print(ans)

Post a Comment

Previous Post Next Post