+ 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
13 Antworten
+ 9
word = str(input())
word1 = set(word)
if len(word) == len(word1):
print("Unique")
else:
print("Deja Vu")
+ 2
The above code is incorrect because m.count must be input.count and must be >1 not >=2
+ 2
I converted input string on set to delete duplicates. Then, i compose lenght of string and set.
+ 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")
+ 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.
0
inp = input()
for i in inp:
if inp.count(i) > 1:
print("Deja Vu")
break
else: print("Unique")
0
word = str(input())
import collections
co = collections.Counter(word)
sum = (sum(co.values()))
if sum > len(co):
print("Deja Vu")
else:
print ("Unique")
0
print((lambda i:'Unique' if sorted(i)==sorted(set(i)) else 'Deja Vu')(input()))
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
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")
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")
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')
0
If anyone could fix this problem,
randominput = str(input())
letters = 'aaaaaaaghhhhjkll'
if randominput == letters:
print("Deja Vu")
else:
print("Unique")