Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
Have two variables for min and min2, initialized at values higher than the values you can find in the 2d array. Use nested loops to browse the array, comparing each value with min, and when it's lower than min, put the value of min in min2, and update min. After the main loop ends, min2 will have the 2nd min value of the 2d array (provided the array has at least two elements).
9th Sep 2016, 9:38 AM
Zen
Zen - avatar