Solve Subarray Sum and Local Minimum | Meta Coding Question