Full threadalex-ant·That was an interview question at one of my first jobs, had to take few minutes to figure out.View on HN