How can i get full 100 points in this one? (SMPAIR)

Q:SMPAIR Problem - CodeChef
P:CodeChef: Practical coding for everyone
where I am loosing points?

Just find the minimum element and the second least element

You are looping for every possibility which is not required. Just sort the list and print sum of the 1st and 2nd element (1-indexed)

1 Like

What’s wrong with the old thread?

3 Likes

why dont you sort the array and take the first two element sumcode here

1 Like