1. Linear Recurrence
current = max(a[i], current + a[i])
best = max(best, current)
current / best
current = max(a[i], current+a[i])
best = max(best,current)
current = max(a[i], current + a[i])
best = max(best, current)
Initialize current and best with first element to handle all negatives gracefully.