Genius School interview question

Solutions types