<jupyter_start><jupyter_text>Kadane's Algorithm   (largest/Maximum sum of the contiguous subarray )<jupyter_code>liss = [ [1, 2, 3 ,-2 ,5 ] , [-1, -2 ,-3, -4]]
for a in liss:
  max_so_far =a[0] 
  curr_max = a[0]
  for i in range(1,len(a)): 
      curr_max = max(a[i], curr_max + a[i]) 
      max_so_far = max(max_so_far,curr_max)  
  print(max_so_far)<jupyter_output><empty_output><jupyter_text>second Best SOlution --> Priyansh<jupyter_code>liss = [ [1, 2, 3 ,-2 ,5 ] , [-1, -2 ,-3, -4]]
for arr in liss:
  n = len(arr)
  dp=[]
  dp.append(arr[0])
  for i in range(1,n):
    dp.append(max(arr[i],dp[i-1]+arr[i]))
  print(dp)
  print(max(dp))<jupyter_output><empty_output><jupyter_text>Third sOLUTION<jupyter_code>liss = [ [1, 2, 3 ,-2 ,5 ] , [-1, -2 ,-3, -4]]
for A in liss:
  N = len(A)
  arrmax=[]
  arrmax.append(A[0])
  currmax=A[0]
  for i in range(1,N):
      if(A[i]<currmax+A[i]):
          currmax+=A[i]
      else:
          currmax=A[i]
      arrmax.append(currmax)
  print(max(arrmax))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19436345966958213, 'fraction_numerical': 0.03498542274052478, 'mean_word_length': 3.517543859649123, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '118353', 'license': 'MIT', 'n_tokens_mistral': 504, 'n_tokens_neox': 485, 'n_words': 93, 'path': 'python/Maximum_sum_of_the_contiguous_subarray.ipynb', 'repo_name': 'priyanshgupta1998/Programming-', 'size': '1029'}