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.
because when you erase some part of string, the length changes. and we need to start from beginning of string, hence we require i=-1, which will become i=0 after updation in the for loop.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Super Reduced String
You are viewing a single comment's thread. Return to all comments →
because when you erase some part of string, the length changes. and we need to start from beginning of string, hence we require i=-1, which will become i=0 after updation in the for loop.