PartnerPath Interview Question

It was a question on algorithm.