comefrom: <doocs>0696.Count Binary Substrings_1.py
code: def countBinarySubstrings( s: str) -> int:
      i, n = 0, len(s)
      t = []
      while i < n:
          cnt = 1
          while i + 1 < n and s[i + 1] == s[i]:
              cnt += 1
              i += 1
          t.append(cnt)
          i += 1
      ans = 0
      for i in range(1, len(t)):
          ans += min(t[i - 1], t[i])
      return ans
masked: def sample_funcname ( var_0 : str ) -> int :
      var_1 , var_2 = 0 , len ( var_0 )
      var_3 = [ ]
      while var_1 < var_2 :
          var_4 = 1
          while var_1 + 1 < var_2 and var_0 [ var_1 + 1 ] == var_0 [ var_1 ] :
              var_4 += 1
              var_1 += 1
          var_3.append ( var_4 )
          var_1 += 1
      var_5 = 0
      for var_1 in range ( 1 , len ( var_3 ) ) :
          var_5 += min ( var_3 [ var_1 - 1 ] , var_3 [ var_1 ] )
      return var_5
  