Quantiphi Interview Question

Two pointer problem and merge sort