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.
I used a condition to check if the absolute difference between the counts of the chosen characters is at most 1, which is the case with valid t's. That would make the code quite faster if we had very large strings.
Two Characters
You are viewing a single comment's thread. Return to all comments →
I used a condition to check if the absolute difference between the counts of the chosen characters is at most 1, which is the case with valid t's. That would make the code quite faster if we had very large strings.