title: maximum subarray of an array with integers
body: <p>In an interview one of my friends was asked to find the subarray of an array with maximum sum, this my solution to the problem , how can I improve the solution make it more optimal , should i rather consider doing in a recursive fashion ?  </p>
  
  <pre><code>def get_max_sum_subset(x):
          max_subset_sum = 0
          max_subset_i = 0
          max_subset_j = 0
          for i in range(0,len(x)+1):
              for j in range(i+1,len(x)+1):
                  current_sum = sum(x[i:j])
                  if current_sum &gt; max_subset_sum:
                      max_subset_sum = current_sum
                      max_subset_i = i
                      max_subset_j = j
          return max_subset_sum,max_subset_i,max_subset_j
  </code></pre>