Only 1 testcase running
Can you plz tell the approach you have used in your code, since I am not able to understand your code.
I have added comments in the code … Andexplained the approach
Lokesh, your code is showing some compilation error, plz send correct code.
…
Compiled
Lokesh your code is not producing answer in correct sequence,
You can refer to this for making changes in your code,