Refer my solution : https://www.codechef.com/viewsolution/26888665.
You can understand the solution by looking at the code, if you don’t understand, let me know.
Thanks for reading.
Peace
I have gone through your code it has also used the same logic of finding max and second max of any array , but I used the same logic and did not get AC , have I done something wrong ,please point out because I can’t figure out
Thanks for helping i thought just by finding the max and min in the array would do the job but apparently it did not.
1 Like