UBS interview question

Two hours test in Hackerrank.