comefrom: <doocs>2155.All Divisions With the Highest Score of a Binary Array_1.py
code: def maxScoreIndices( nums: List[int]) -> List[int]:
      left, right = 0, sum(nums)
      mx = right
      ans = [0]
      for i, num in enumerate(nums):
          if num == 0:
              left += 1
          else:
              right -= 1
          t = left + right
          if mx == t:
              ans.append(i + 1)
          elif mx < t:
              mx = t
              ans = [i + 1]
      return ans
masked: def sample_funcname ( var_0 : List [ int ] ) -> List [ int ] :
      var_1 , var_2 = 0 , sum ( var_0 )
      var_3 = var_2
      var_4 = [ 0 ]
      for var_5 , var_6 in enumerate ( var_0 ) :
          if var_6 == 0 :
              var_1 += 1
          else :
              var_2 -= 1
          var_7 = var_1 + var_2
          if var_3 == var_7 :
              var_4.append ( var_5 + 1 )
          elif var_3 < var_7 :
              var_3 = var_7
              var_4 = [ var_5 + 1 ]
      return var_4
  