W3 Engineers interview question

mid level coding questions(leetcode pattern)