PerBlue interview question

Two coding questions close to leetcode easy problems