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)
What’s wrong with the old thread?
why dont you sort the array and take the first two element sumcode here