Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
TCS Digital phase 1 12 july 2019
# given the list of phone numbers check if any no from from list also starts with the prefix of another number # like 911 #911028 # this two nos are ambigous consistent = True N = int(input()) L = [int(input()) for _ in range(N)] for i in range(N): c = str(L[i]) for j in range(N): if i==j: continue d = str(L[j]) if d.startswith(c): consistent=False break if(not consistent): break if consistent: print("YES") else: print("NO")
run
|
edit
|
history
|
help
0
Python3
Leibnitz Series To Estimate Pi
Student
pico menu
abstractmethod
Your mom
Game2
gj
Rhymes child
sainik