Can anyone help with this problem: https://www.hackerrank.com/challenges/fighting-pits/problem. I have searched over internet but couldn't find any content related to it.
I have also tried understanding editorial but it has gone over my head. Any resource, approach(with proof) or problems related to it will be appreciated.