Why three of my testcases are failing but one testcase is passing ?
Doubt in my code
hello @yashsharma4304
check now->
when two consecutive elements are equal (i,i+1) then discard i and continue from i+1
But what was the problem with my approach. In my approach I was checking if (i, i+1) are equal then skip i+1 and move to i+2 and before moving to i+2 copy the element from i to j.
Else copy the element from i to j and move to i+1 and j+1
it fails for cases like this->
aaaa
1 Like
Ohk… Thank you for resolving my doubt.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.