I need to find smallest and second smallest number in a list.
Can I do this using single loop?
Also, we need to consider the case of two multiple occurences of a number.
Ex: 1. from list [20,30,90,50] output 20 ,30
2. from list [30,30,90,50] output 30 ,30
plz help
I am sorry, Actually I dont have list of Integers. But I ahve list of objects.
Anyways, thanks for the help. I hope the following code works