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
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #98: Anagramic squares

Project Euler #98: Anagramic squares

Problem
Submissions
Leaderboard
Discussions

This problem is a programming version of Problem 98 from projecteuler.net

Some square numbers are numerical anagrams of other square numbers. For instance, and . The set of square anagrams of is .

For each value of , we wish to know the largest set of square anagrams for a number with digits. Print out the largest number of this set. If the largest set is not unique, pick whichever one has the largest maximum element.

Input Format

The only number - the length of the needed anagram.

Output Format

The -digit number which is the largest square with the most anagramic squares of length .

Sample Input

4

Sample Output

9216

Author

shashank21j

Difficulty

Easy

Max Score

100

Submitted By

1450

Need Help?


View discussions
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature