Sollicitatievraag bij Point72

Easy hackerrank question made harder by requiring linear time complexity