Capital One interview question

Summary Ranges Leetcode problem