You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* The trick in the Question is to realize that the string can only contain 'a' and 'b'.
If the string is a palindrome, you can straightaway remove it which takes only 1 step.
If it is not palindrome, then club all A's together into one palindrome, and all Bs together in another. Then remove both the palindromes one by one which take 2 steps.