We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Nice solution. I've optimised it a bit so that we don't have to reverse the reduced string at the end by iterating through the original string in reverse order. This results in the stack being in forward order. Then a simple concatenation of the stack gives us the reduced string.
Super Reduced String
You are viewing a single comment's thread. Return to all comments →
Nice solution. I've optimised it a bit so that we don't have to reverse the reduced string at the end by iterating through the original string in reverse order. This results in the stack being in forward order. Then a simple concatenation of the stack gives us the reduced string.