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.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #90: Cube digit pairs
  4. Discussions

Project Euler #90: Cube digit pairs

Contest ends in
Problem
Submissions
Leaderboard
Discussions

Sort 6 Discussions, By:

recency

Please Login in order to post a comment

  • Jarekczek
    5 months ago+ 0 comments

    I would make something more explicit.

    one way this can be achieved is by placing 056789 on one cube and 123489 on the other cube

    One could think that it counts as 2 solutions:

    • 056789 on the first one, 123489 on the second
    • 123489 on the first one, 056789 on the second

    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:

    0	1	3136
    0	01	3920
    01	01	2485
    01	1	3920
    
    0|
    Permalink
  • robin_vezina
    3 years ago+ 0 comments

    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.

    0|
    Permalink
  • kitchent
    5 years ago+ 0 comments

    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.

    0|
    Permalink
  • georeth2010
    6 years ago+ 0 comments

    Dice with different orders are considered as the same variant. (die1, die2) = (die2, die1).

    n=10 m=3 ans=294197

    3|
    Permalink
  • Ved5288
    6 years ago+ 2 comments

    Hey

    When there are more than 1 cube into consideration and say for the first cube the number of possibilities are 70 and for the second cube the number of possibilities are 126.

    Shouldn't the number of distinct arrangements be 70*126. I am bit stuck up at this point. Can someone give me a sample testcase for more than one cube in consideration

    0|
    Permalink
Load more conversations

Need Help?


View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy