Garmin Interview Question

there was a leetcode easy problem