LinkedIn interview question

2 Leetcode problems - one easy and one easy