In array method, I am finding TLE I guess, and in vector method I guess equality of max elements is causing a problem acc. to me. I am not getting new approach.
Help me with the approach
Hi @sr30
I have modified your array approach and it works perfectly.
Code for Reference : https://ide.codingblocks.com/s/195475
Hope it Helps.