Pregunta de entrevista de Morgan Stanley

Leetcode medium question, followed by questions on SQL, design patterns, linux and Java OOP for superday