loop for all S in this F
find each S highest value
keep this in a hashset1 (key=S, value= max value)
order each S value in increasing order
keep this in another hashsset2 (key = S, value = list of values)
end loop for all S
order hashset1 in increasing order
loop hashset1
pick up each S
loop hashset2
pick up each element (roll no, plies, values)
show that on screen
end loop hashset2
end loop hashset1
// Code is most welcome... Literally have worked with this but couldn't break the jinx with their key-value.