KSquare Solutions interview question

Javascript algorithm challenges