Checkpoint interview question

Showed a coding example and asked me to solve it with mutliple solutions, while sharing screen