A typo in question


if string is “aabbbad” and value of B is 3 then the asnwer should be “d” but the compiler is showing “aaad”


We are asked to remove consecutive characters. In “aabbbad”, 3 b’s are consecutive but 3 a’s are not consecutive so we cannot remove them.


but after removing three B we’ll get three consecutive A