Nordstrom interview question

Vo: leetcode 279, very easy