Aersys interview question

Two east/medium Medium leetcode questions