HomeX interview question

Q) Online Javascript Algorithm solving.