X Interview Question

the questions are 4 random leetcode questions