CIBC Interview Question

Was asked leetcode easy question