Nordstrom interview question

regular leetcode problem easy to medium