+ 3

How slove.this error=Array.index.out.bound.excdption

hi htts://code.sololearn.com/c7BFcXUY9975/?ref=app

15th Oct 2018, 8:23 AM
Rameshwar Shivshette
Rameshwar Shivshette - avatar
3 Antworten
+ 3
sorry I didn't get...
16th Oct 2018, 4:14 AM
Rameshwar Shivshette
Rameshwar Shivshette - avatar
+ 2
If you enter " 1 1 1 2 2 " The program will work because the for loop for the second table will only execute once. the error will be if we enter e.g. "5 1 2 3 " Because the second for loop want to do 5 times and the second array has size 3. In both for loops references the variable n which represents only the size of the first array
16th Oct 2018, 1:43 PM
Daniel (kabura)
Daniel (kabura) - avatar
+ 1
Because the first list can be larger than the second
15th Oct 2018, 8:12 PM
Daniel (kabura)
Daniel (kabura) - avatar