This is the question I am trying to solve. This is my attempt.
To find minimum is easy. For maximum I am iterating from end and finding lower bound, then upto the lower bound index I can assign maximum value to the number.
This approach is giving WA on Test 2. Please help me correct my approach?
I will be thankful for any help!
Thanks so much for help!