Number algorithms
Number algorithms
- 20
Locked
Comments (8)
- Popular
- New
- Old
You must be signed in to leave a comment
LaikaLaikaka
18 April 2025, 19:42
In the two test cases, my solution returned correct array(not not include 0), but idk why it failed validation
0
jjopc
20 November 2021, 18:59
I don't see the point of this extremely difficult task at this point in the course. I could only get over it by searching in google and reading the help section.
+2
Gellert Varga
28 December 2021, 00:07
I feel the same way.
But here is a very unique idea:
There are only 89 Armstrong numbers in the decimal number system. All 89 are listed here:
https://hu.wikipedia.org/wiki/Armstrong-szám
or here:
https://mathworld.wolfram.com/NarcissisticNumber.html
- Put all of them in a long[] array (that are less than Long.MAX_VALUE).
- Use this array to return the results.
- Exception: CG does not accept zero as an Armstrong number. So take zero out of the long[] array mentioned above.
(I wish I could come up with such great ideas... but this solution was not my idea, it is from another user. And the validator accepts it. By the way, I have no idea how to make an algorithm that is able to check 9223372036854775807 numbers in less than 10 seconds.)
+2
Youssef Amajout Talidni Future Java DEV
11 February 2024, 15:20
Didn't work for me
0
Bart De Lepeleer
17 December 2020, 17:22
Use Google, or work a lot 😀
0
Anthony Mack
15 December 2020, 16:02
If I run my solution w/o verification it returns the arrays from the Solution input w/o a problem. However, whenever I run the validation, it states that it looks like I have an infinite loop. What gives?
0
Roman
18 December 2020, 07:13
Please post your question with the attached solution in the section Help.
0
Oleksii Chernysh
6 December 2019, 21:22
Interesting task and no pain from validator compared to some previous tasks. Good to know that numbers start from 1, not 0. Possibly this is obvious but I didn't realize this from the requirements. And understood that these are Armstrong numbers only after solving the problem.
0