MaxSubArray - A logarithmic solution