comefrom: <garvit244>410_1.py
code: def splitArray( nums, m):
      left, right = max(nums), sum(nums)
      
      while left < right:
          mid = left + ((right-left) >> 1)
          curr_sum, invalid, groups = 0, True, 0
          for num in nums:
              if num > mid:
                  inalid = False
                  break
              if num + curr_sum > mid:
                  groups += 1
                  curr_sum = 0
              curr_sum += num
          if invalid and groups < m:
              right = mid
          else:
              left = mid + 1
      return left
masked: def sample_funcname ( var_0 , var_1 ) :
      var_2 , var_3 = max ( var_0 ) , sum ( var_0 )
      while var_2 < var_3 :
          var_4 = var_2 + ( ( var_3 - var_2 ) >> 1 )
          var_5 , var_6 , var_7 = 0 , True , 0
          for var_8 in var_0 :
              if var_8 > var_4 :
                  var_9 = False
                  break
              if var_8 + var_5 > var_4 :
                  var_7 += 1
                  var_5 = 0
              var_5 += var_8
          if var_6 and var_7 < var_1 :
              var_3 = var_4
          else :
              var_2 = var_4 + 1
      return var_2
  