My code has a bug. | SoloLearn: Learn to code for FREE!

+1

My code has a bug.

I’m trying To fix the sorting https://code.sololearn.com/c2kBw11ORVJF/?ref=app

3/9/2020 2:41:48 AM

Microne mafika

1 Answer

New Answer

+1

In your loops use this, otherwise you get out of range: for(int i=0; i< li.Count -1; i++) { for(int j = 0; j<li.Count -1; j++) and: temp =li[j]; // it should be li[j] li[j]=li[j+1]; li[j+1]=temp;