We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #90: Cube digit pairs
Project Euler #90: Cube digit pairs
Sort by
recency
|
7 Discussions
|
Please Login in order to post a comment
I did not find this easy. Very tedious or maybe I didn't discover the "trick." This leads to frustration and diminished enjoyment. That's why I hope this helps someone and they can improve on this solution (and share their discovery with all). HackerRank Project Eulrer 90
I would make something more explicit.
One could think that it counts as 2 solutions:
This is not the case. It counts as 1 solution.
So for 9 2 the answer is 1217.
For 1 2 the answer is 13461. It can be also computed manually:
If the question had used the term dice instead of cube it would have been fun to add the input
S
for the number of sides on the dices.A single cube only has 210 arrangements.
Hint: Generating all combinations of 3 dices works for this problem in Python. At first I thought there must be some other approach to pass all test cases, but it turns out if you find the right way to implement your combinations loop which avoids iterating through duplicate choices of dices, it would be fine.
Dice with different orders are considered as the same variant. (die1, die2) = (die2, die1).
n=10 m=3 ans=294197