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 
can you please explain your approach?
Sorry. Wrong approach. I tried for other testcases and was giving wrong output. Thanks anyway 