Ramp interview question

A Leetcode medium-ish (on the easier end)