comefrom: <doocs>2380.Time Needed to Rearrange a Binary String_1.py
code: def secondsToRemoveOccurrences( s: str) -> int:
      ans = cnt = 0
      for c in s:
          if c == '0':
              cnt += 1
          elif cnt:
              ans = max(ans + 1, cnt)
      return ans
masked: def sample_funcname ( var_0 : str ) -> int :
      var_5 = var_3 = 0
      for var_6 in var_0 :
          if var_6 == '0' :
              var_3 += 1
          elif var_3 :
              var_5 = max ( var_5 + 1 , var_3 )
      return var_5
  