Quantiphi interview question

Two pointer problem and merge sort