This program is Ruby solution to find largest sum of contiguous sub-array and it is based on Kadane's algorithm.
Problem reference: https://en.wikipedia.org/wiki/Maximum_subarray_problem
Usage:
1. Clone this repo
2. Run the ruby program `ruby max_sub_array.rb`
3. Input: -2 1 -3 4 -1 2 1 -5 4
4. Output:
Start Index: 3
Length: 4
Sum: 6
Elements: [4, -1, 2, 1]