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_3 , var_5 = max ( var_0 ) , sum ( var_0 )
      while var_3 < var_5 :
          var_7 = var_3 + ( ( var_5 - var_3 ) >> 1 )
          var_9 , var_11 , var_12 = 0 , True , 0
          for var_13 in var_0 :
              if var_13 > var_7 :
                  var_15 = False
                  break
              if var_13 + var_9 > var_7 :
                  var_12 += 1
                  var_9 = 0
              var_9 += var_13
          if var_11 and var_12 < var_1 :
              var_5 = var_7
          else :
              var_3 = var_7 + 1
      return var_3
  