Ken Research interview question

2 leetcode questions, language based quetions