Meta Interview Question

2 Leetcode style questions - one easy and one mid