+ 4

Can u Fix my code?

Task description: # Create a program that check if you are typin unique letter in every tuch # Input Format: A string of random letters or characters # Output format: A string that say 'Deja Vu' if letter in repetad or 'Unique' if is not repeted # Sample input: aaskjloj Output: Deja Vu Ex. Input aaaaattty. The output will be deja vu Can any one fix my code it failed at 3,4 test https://code.sololearn.com/c0ZQ11W3Tes0/?ref=app

27th Jul 2020, 6:05 PM
Agazi Birhanu
Agazi Birhanu - avatar
9 Respuestas
+ 2
Congratulations Agazi Birhanu . Another solution could be without sorting, if you would compare „len()“ of a and b. If equal that means unique.
27th Jul 2020, 7:25 PM
JaScript
JaScript - avatar
27th Jul 2020, 7:19 PM
Agazi Birhanu
Agazi Birhanu - avatar
+ 3
Agazi Birhanu , I can suggest the following approach based on your code: convert the set of the input to sorted list. Convert the input list in sorted list. Compare both of these lists, if they are not equal print "Deja Vu", otherwise "Unique".
27th Jul 2020, 6:52 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 2
We cannot see a Code Coach side. First you have to save it on the Playground and link in your question.
27th Jul 2020, 6:15 PM
JaScript
JaScript - avatar
+ 2
The idea is not bad. But at the end you compare false property. Please print your a and b and see what happened. After that I belive you get that.
27th Jul 2020, 6:51 PM
JaScript
JaScript - avatar
+ 2
Another approach would be to loop through the input and use the count method or use a dictionary counter.
27th Jul 2020, 7:09 PM
Tomiwa Joseph
Tomiwa Joseph - avatar
+ 2
Ya clever one.
27th Jul 2020, 7:41 PM
Agazi Birhanu
Agazi Birhanu - avatar
+ 1
I am a newbie in coding, how does it work please?
29th Jul 2020, 11:59 AM
Stephen Great
0
It's possible for one to learn coding without having any skills knowledge about argoritin ?
29th Jul 2020, 12:02 PM
Stephen Great