MRSOOL interview question

Solve algorithmic problems with an analysis.