Help me on these Test cases


#1

Like the question said to Remove all consecutive same characters that have length exactly B.
For example A= aaaad, B=2, the solution given in the hint section outputs “aaaad”.
Whereas i submit a solution which outputs “d” and it got accepted too.
SO, which one is correct and why not the other one.