Implement a balance tracker and interval merger | Rippling Coding Question