+ 1

TEST CASE TROUBLE T__T

import java.util.Scanner; public class DejaVu { public static void main(String[] args) { Scanner input = new Scanner(System.in); String S1 = input.next(); String ABC = "abcdefghijklmnopqrstuvwxyz"; char [] A = S1.toCharArray(); char [] c = ABC.toCharArray(); int [] d= new int[26]; int sum = 0; for (int p=0;p<26;p++){d[p]=0;} for(int i=0; i

10th Apr 2020, 10:19 AM
RnTLee
RnTLee - avatar
5 Answers
+ 5
Run this code and check whether this works or not. import java.util.Scanner; public class DejaVu { public static void main(String[] args) { Scanner input = new Scanner(System.in); String S1 = input.next(); String ABC = "abcdefghijklmnopqrstuvwxyz"; char [] A = S1.toCharArray(); char [] c = ABC.toCharArray(); int [] d= new int[26]; int sum = 0; for (int p=0;p<26;p++){d[p]=0;} for(int i=0; i
10th Apr 2020, 10:30 AM
...
+ 3
RnT.Lee you are right Actually I have made one change in code. You can right greater than 2 instead of greater than or equal to 3.
10th Apr 2020, 11:16 AM
...
+ 1
Swapnil OMG, it worked. @@ but I don't get it. What the difference between "counter>=2" and "counter>=3"?? "Repeated" means there are 2 or more of same letter in the input string, isn't it?
10th Apr 2020, 10:55 AM
RnTLee
RnTLee - avatar
0
maybe you should also take into account capital letters.
10th Apr 2020, 10:39 AM
John Robotane
John Robotane - avatar
0
Super
10th Apr 2020, 5:23 PM
Kalki Is
Kalki Is - avatar