New Licence | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

New Licence

Soo I Have been Working on this, I don't know how to optimize it to pass the code coach What is the problem? Lesson:

24th Feb 2020, 5:43 AM
Rodrigo Sanchez
Rodrigo Sanchez - avatar
2 Answers
+ 1
your array is too short try input: "eee\n 2\n bbb aaa ccc ddd" you get: [aaa, bbb, ccc, ddd, eee] list [[aaa, bbb], [ccc, ddd]] arr 40 eee is not in arr, because for() stops at the end of arr, at name ddd,, not eee and return wrong answer then your code produce warning because you use unchecked raw ArrayList for better result, use extra <> in declaration: //ArrayList<String> list = new ArrayList(); ArrayList<String> list = new ArrayList<>();
24th Feb 2020, 9:03 AM
Thank You So Much For Feed Back I Will Try To Fix
25th Feb 2020, 6:51 AM
Rodrigo Sanchez
Rodrigo Sanchez - avatar