Retired
Narcissistic number with constant base (retired)
20Yanni2
Loading description...
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Hey man... Did you check the tests one-by-one?
According to the example in the instructions, we have to take an input number, and the base of the expansion is the length of that number... Right? And then calculate for each digit of the input number: base^digit.
But in some tests it fails... For example, when we take the number 12, the base is 2, so we get: 2^1 + 2^2 = 2 + 4 = 6, but the test isnarcissistic(12) returns True instead of False.
Why is the base 2? Try it with base 3. You may need to check many bases to know the final result.
It seems you didn't really understand the task, and tests seem to be fine. That's not a kata issue.
This sentence is incorrect, and the task is different from what is said here. Also, this has nothing to do with narcissistic numbers.
Why should it have nothing to do with narcissistic numbers? Narcissistic numbers also include numbers where the exponent is changed.
Which title would you then suggest for the katar?
What? A narcissistic number by definition is a number where the following equation is true:
sum(digit**len(number) for digit in number) == number
. You're asking for a completely different thing.