File tree Expand file tree Collapse file tree
kata/7-kyu/find-the-index-of-the-second-occurrence-of-a-letter-in-a-string Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11interface SecondOcurrence {
2- static int second_symbol (String str , char c ) {
2+ static int secondSymbol (String str , char c ) {
33 return str .indexOf (c , str .indexOf (c ) + 1 );
44 }
55}
Original file line number Diff line number Diff line change 55class SolutionTest {
66 @ Test
77 void sample () {
8- assertEquals (3 , SecondOcurrence .second_symbol ("Hello world!!!" , 'l' ));
9- assertEquals (7 , SecondOcurrence .second_symbol ("Hello world!!!" , 'o' ));
10- assertEquals (-1 , SecondOcurrence .second_symbol ("Hello world!!!" , 'A' ));
11- assertEquals (-1 , SecondOcurrence .second_symbol ("Hello" , '!' ));
12- assertEquals (-1 , SecondOcurrence .second_symbol ("" , 'q' ));
8+ assertEquals (3 , SecondOcurrence .secondSymbol ("Hello world!!!" , 'l' ));
9+ assertEquals (7 , SecondOcurrence .secondSymbol ("Hello world!!!" , 'o' ));
10+ assertEquals (-1 , SecondOcurrence .secondSymbol ("Hello world!!!" , 'A' ));
11+ assertEquals (-1 , SecondOcurrence .secondSymbol ("Hello" , '!' ));
12+ assertEquals (-1 , SecondOcurrence .secondSymbol ("" , 'q' ));
1313 }
1414}
You can’t perform that action at this time.
0 commit comments