Adjacent Pairs Codechef Solution