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 #30: Digit Nth powers
  4. Discussions

Project Euler #30: Digit Nth powers

Problem
Submissions
Leaderboard
Discussions

    You are viewing a single comment's thread. Return to all comments →

  • kumar_mahendra
    2 years ago+ 1 comment

    My Approach - First find all possible numbers that a K-digit number could have for example I treated [1,2,3],[2,1,3],[1,3,2],[2,3,1],[3,1,2],[3,2,1] all as same and I find only one of them and not repeated numbers with same digits (using recursive appraoch) since what we are interested in only digits which constitute K-digit number . this way my algorithm is very fast and will also work if N (input) is even more than 6 .

    0|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy