Thought Machine interview question

2 DSA and code review