DevRev interview question

Solve DSA with javascript language