Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. A subarray is a contiguous part of an array.
/**
* @param {number[]} nums
* @return {number}
*/
// Approach
// Like a sliding window technique
// Keep track of max = -Infinity and runningSum = -Infinity
// For each num in nums
// Ask is the running sum + num greater than the current number? running sum + num
// If it's less than the current number, the running sum is the current number to ignore the running sums that would make it for sure less than the max