Comments

Thank you. Now it makes sense.

+5

You can't

Thank you so much. I was able to get it accepted. Makes sense I am either inserting or deleting abc from the set. but instead doing it both when applicable gives the correct result.

I believe that case is already covered internally in my code.

if s[pos] is already c and string abc can be formed with the neighbouring characters we insert into the set which causes no change to the set since the set already contains that value.

Can anyone help me understand why my submission for B is getting WA on test 3. My approach is exactly same as in editorial. can't seem to find the edge case. help will be truly appreciated.137250167