Number of Ways to Wear Different Hats to Each Other

Number of Ways to Wear Different Hats to Each Other - Coding Problem | K5kC