Sock Merchant - Hacker Rank Solution