+ 1

how to solve Deja Vu in coach problem

m =list(input()) for i in m : n =((m.count(i)) print(n) if (n >1): print("Deja Vu") else: print("Unique") File "source_file.py", line 6 print (n) ^ SyntaxError: invalid syntax

9th Jan 2020, 1:21 PM
Vikram Singh
Vikram Singh - avatar
13 Antworten
+ 9
word = str(input()) word1 = set(word) if len(word) == len(word1): print("Unique") else: print("Deja Vu")
5th Jun 2021, 1:24 PM
Przemysław Komański
Przemysław Komański - avatar
+ 2
The above code is incorrect because m.count must be input.count and must be >1 not >=2
17th Feb 2021, 6:57 PM
Ali Mehdipoor
Ali Mehdipoor - avatar
+ 2
I converted input string on set to delete duplicates. Then, i compose lenght of string and set.
5th Jun 2021, 1:30 PM
Przemysław Komański
Przemysław Komański - avatar
+ 2
Here is my solution str = input("") s_str =sorted(str) c=0 for i in range(len(s_str)): if(s_str[i]==s_str[i-1]): c+=1 if c>0: print ("Deja Vu") else : print ("Unique")
5th Feb 2022, 3:05 AM
RISHIRAM K
RISHIRAM K - avatar
+ 1
input = input() con= False for l in input : if m.count(l) >= 2: con= True if con: print("Deja Vu") else: print("Unique") This is my solution.
30th Nov 2020, 3:17 PM
Patrick Saft
Patrick Saft - avatar
0
inp = input() for i in inp: if inp.count(i) > 1: print("Deja Vu") break else: print("Unique")
23rd Jan 2020, 12:26 AM
Onuoha_ifeanyi
Onuoha_ifeanyi - avatar
0
word = str(input()) import collections co = collections.Counter(word) sum = (sum(co.values())) if sum > len(co): print("Deja Vu") else: print ("Unique")
27th Apr 2020, 7:18 PM
Мансур Валиев
Мансур Валиев - avatar
0
print((lambda i:'Unique' if sorted(i)==sorted(set(i)) else 'Deja Vu')(input()))
11th Jun 2021, 11:06 AM
Naveen Surya
Naveen Surya - avatar
0
x = input() list = x.split() var = list[0] list = ["a","b","d","e","f","m"] for x in list: n = 0 k = 0 while n < len(var): text = var[n] n += 1 if text == x: k += 1 if k > 1: print("Deja Vu") else: print("Unique") Working 100% not add all alphabet you can enter all the letters in the list yourself
2nd Feb 2022, 3:04 PM
Zayniddin Kamolov
0
palabra = input() L=set(palabra) dic={} for letra in L: dic[letra]=palabra.count(letra) valores = list(dic.values()) lista=[] for elem in valores: if(elem>=2): lista.append(elem) if(len(lista)>0): print("Deja Vu") else: print("Unique")
19th Mar 2022, 12:11 PM
Alex
0
if you looking for another sulotion for learn : import re list = set() x = input() for i in x: y = re.findall(i, x).count(i) list.add(y) if max(list) > 1: print("Deja Vu") else: print("Unique")
27th Aug 2022, 11:00 AM
Meysam
Meysam - avatar
0
zin = input() counter=0 for x in zin: if zin.count(x) > 1: counter += 1 if counter > 0: print('Deja Vu') else: print('Unique')
29th Dec 2022, 4:27 PM
Laurent
0
If anyone could fix this problem, randominput = str(input()) letters = 'aaaaaaaghhhhjkll' if randominput == letters: print("Deja Vu") else: print("Unique")
2nd Jan 2023, 3:59 PM
Haris
Haris - avatar