Intel Corporation Interview Question

2 technical questions from leetcode