Squarepoint Capital Interview Question

Solve a Hakerank programming problem