hackerrank. Distinct powers.