I have tried the same approach to solve @CHEFSTEP which almost everyone had given in the contest but my c++ solution is giving TLE, I don’t know why?
And today when I did it with python the solution got accepted…
I wanted to know my mistake so that I may not repeat it…Please help.
My C++ code:-
My Python Code which got accepted:-