A typo in question


#1

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


#2

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.


#3

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