Problem 2 in python language
- n, m = map(int, input().split())
- a = [input() for i in range(n)]
- ans = ''
- for i in range(n):
- for j in range(m):
- if a[i].count(a[i][j]) == 1 and ''.join(a[k][j] for k in range(n)).count(a[i][j]) == 1:
- ans += a[i][j]
- print(ans)
Post a Comment