HackerEarth Interview Question

A problem on Combinatorics