- 1

Has anyone solution to deja vu in java?

https://www.sololearn.com/coach/54?ref=app

18th Jan 2021, 3:00 PM
Manfred h
13 Answers
+ 3
If you have tried to solve the problem, then copy it and give it to me and I will help you.....😊
20th Jan 2021, 7:54 AM
Abdul Raheem
Abdul Raheem - avatar
+ 2
Did you try to solve the problem
20th Jan 2021, 7:48 AM
Abdul Raheem
Abdul Raheem - avatar
+ 1
The links you shared are private. Others can't see. Copy paste in playground and save, share link here. So that helps you find if any mistakes..!
18th Jan 2021, 6:55 PM
Jayakrishna 🇮🇳
18th Jan 2021, 3:28 PM
Ezra Bridger 2207 [INACTIVE]
Ezra Bridger 2207 [INACTIVE] - avatar
0
it gives me an error
18th Jan 2021, 3:34 PM
Manfred h
0
It's in python!!!
18th Jan 2021, 3:42 PM
Ezra Bridger 2207 [INACTIVE]
Ezra Bridger 2207 [INACTIVE] - avatar
0
Sanoj first try it yourself if you have any doubts and then ask to someone they will help you
18th Jan 2021, 4:44 PM
❤☆Nani☆❤
❤☆Nani☆❤ - avatar
0
i tried for 1.5 hours
18th Jan 2021, 4:53 PM
Manfred h
0
Oh ! Then where is your attempt 🤔 🙄 ?Sanoj
18th Jan 2021, 5:43 PM
❤☆Nani☆❤
❤☆Nani☆❤ - avatar
0
i will copy it tomorrow from my IDE
18th Jan 2021, 8:19 PM
Manfred h
0
Here it is s = str(input()) c= 0 for i in s: n=s.count(i) if n>1: print("Deja Vu") c=0 exit(0) else: c+=1 if c>0: print("Unique")
20th Jan 2021, 8:49 AM
Surkhab Khan
Surkhab Khan - avatar
0
I’ve spent more than 10 hours to solve “Deja Vu” task. It is my code. I wonder how to make it shorter and clear? Scanner sc = new Scanner(System.in); String words = sc.nextLine(); char [] letter = words.toCharArray(); int l = letter.length; String res = ""; for (int y = 0; y<l-1; y++){ for (int i = y+1; i<l; i++){ if (letter[y] != letter[i]){ res = "Unique"; } else { res = "Deja Vu"; break; } } if (res.equals("Unique")){ continue; } else { break; } } if (res.equals("Unique")){ System.out.println(res); } else { System.out.println("Deja Vu"); }
14th May 2021, 10:56 PM
Эльвин Теймуров
Эльвин Теймуров - avatar
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); String s = input.nextLine(); int counter = 0; for(int i = 0; i< s.length(); i++) for(int j = s.length()-1; j>i; j--){ if(s.charAt(i) == s.charAt(j)){ counter++; break; } } if(counter > 0){ System.out.println("Deja Vu"); }else{ System.out.println("Unique");} } }
23rd Mar 2024, 7:07 AM
Александр Морозов
Александр Морозов - avatar