I'm getting WA for this probelm

can you please explain your approach?

Sorry. Wrong approach. I tried for other testcases and was giving wrong output. Thanks anyway :slight_smile: