0

4/5 test cases have passed...1 hidden test case not passed...can someone help me?..what might that case be?..whats wrong here?

Input Format: A string of random letter characters (no numbers or other buttons were pressed). Output Format: A string that says 'Deja Vu' if any letter is repeated in the input string, or a string that says 'Unique' if there are no repeats. Sample Input: aaaaaaaghhhhjkll Sample Output: Deja Vu Explanation: Your program should output 'Deja Vu' because there are many repetitions in 'aaaaaaaghhhhjkll'. a = input() b = list(a) temp = [] con = False for i in b: if i in temp : print('Deja Vu') con = True else: temp.append(i) if con == False : print('Unique') else : pass

20th Mar 2020, 7:51 AM
Chinmay Bhalerao
Chinmay Bhalerao - avatar
3 Respuestas
+ 1
Chinmay Bhalerao This is the correct version of ur code. a = input() b = list(a) temp = [] con = False for i in b: if i in temp: con = True break else: temp.append(i) if con == False: print('Unique') else: print('Deja Vu')
20th Mar 2020, 8:11 AM
maf
maf - avatar
+ 2
If repeated, print Deju Vu and exit loop.. Edit: For aaabc, It printing 2times Deja Vu. Need only one time.
20th Mar 2020, 8:02 AM
Jayakrishna 🇮🇳
+ 1
Chinmay Bhalerao text = input() if sorted(set(text)) == sorted(text): print("Unique") else: print("Deja Vu") This is an easy way. What set() does is that it removes any duplicates, so if after removing duplicates and before removing duplicates is the same, print unique, otherwise dejavu.
20th Mar 2020, 8:05 AM
maf
maf - avatar