Jagged arrays and code coach | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Jagged arrays and code coach

Hi, i have this practice task: "Write a program to take the numbers of each day's winners as input and output them." https://code.sololearn.com/c6q731gg9H51/?ref=app And this code pass 4/5 tests, but 5 test is hidden, so i can't see problem with my solution. So maybe someone can help?

21st Oct 2020, 10:56 PM
Danil Sinopsky
Danil Sinopsky - avatar
2 Answers
0
Which code coach challenge is this? Since you say it passes 4/5 tests and after looking at your code I'd guess it's simply a typo. Also your handling of wrong inputs seems odd. Is it really needed? I guess not, but anyway. Negative values and also 0 still lead to an index out of range Exception. Fix: if(day_Winner<1) day_Winner=1;
24th Oct 2020, 8:01 PM
Benjamin Jürgens
Benjamin Jürgens - avatar
0
This is Jagged Arrays challenge. I'm begginer, so this can be odd things in my code. Thanks
24th Oct 2020, 8:08 PM
Danil Sinopsky
Danil Sinopsky - avatar