We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25a658e commit 2cae78aCopy full SHA for 2cae78a
1 file changed
live11/test113/문제1/백한결.py
@@ -0,0 +1,26 @@
1
+import sys
2
+
3
+def main():
4
+ input = sys.stdin.readline
5
+ t = int(input())
6
7
+ for _ in range(t):
8
+ phoneNumber = []
9
+ n = int(input())
10
+ for i in range(n):
11
+ phoneNumberStr = input().strip()
12
+ phoneNumber.append(phoneNumberStr)
13
14
+ phoneNumber.sort()
15
16
+ isOk = True
17
+ for i in range(len(phoneNumber)-1):
18
+ if phoneNumber[i+1].startswith(phoneNumber[i]):
19
+ print("NO")
20
+ isOk = False
21
+ break
22
+ if isOk:
23
+ print("YES")
24
25
+if __name__ == '__main__':
26
+ main()
0 commit comments