Squarepoint Capital interview question

coding question with two pointers