Find the arrangements

Problem Name:
Find the arrangements
Site:HackerEarth
Links:
Tags: