HTMLify

LeetCode - Time Needed to Rearrange a Binary String - Python
Views: 137 | Author: abh
class Solution:
    def secondsToRemoveOccurrences(self, s: str) -> int:
        secs = 0
        while "01" in s:
            s = s.replace("01", "10")
            secs += 1
        return secs

Comments