Subarray Sum Closest

Using map as bst. O(nlogn).  It needs logN to find the boundary.