TenX Recruiting interview question

Algorithms