https://practice.geeksforgeeks.org/problems/friends-pairing-problem5425/1