Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
some divide-and-conquer algorithm would speed stuff up?
just like SnowQween sad
Thank you so much for the hint.
Thank you so much, yeah I got the output right to for a 5kyu kata too but I got a long way ahead for optimization. Thanks for your advice,
You need something better than
O(n²)
.This comment is hidden because it contains spoiler information about the solution
Hi, and welcome.
First of all, remember to indicate the language you are using when asking for help, more than 50 languages are available on CodeWars. After visiting your profile, I have assumed you have been using JavaScript.
Also, it's a good idea to include all the relevant part of the error logs you receive. I've just tried out your code on attempt tests, and I get this:
Many times, this means your code gets lost in an infinite loop and you keep pushing stuff into an array until getting out of memory and the code crashes. I advice you to have a cautious look at the following help page to debug your solution: https://docs.codewars.com/training/troubleshooting/
If you are a beginner, I would advice you to improve your skills on more basic tasks from the 8 or 7 kyu level. Some 6 kyu katas are pretty basic, but it is not the case of this one.
Hello my thing basically works but I'm getting this too:
100 Random Tests
It should works for random tests too.
Log
Testing for:
n = 80350
I'm new here can I get a hint?
all single digits are narcisitic because anything to the first power is equal to itself or
x^1 = x
7 is narcisitic because of the following.
7 has one digit so I sum that one digit raised to the first power
for comparison
my code works for the most part but I'm stuck with the error 'expected undefined to equal " " ' I don't actually get it. When I change it arounf instead I get 'expected " " to equal undefined'
Just realized, shame on me!!! Anyways I always find it a lot easier to find the mistake after posting for help which then I don't need. Thank you.
You must return the result, not print it.
My code returns the required results but I'm still getting:
expected undefined to deeply equal [ +0, +0, +0 ]
Actual and expected are swapped in PHP, also assertion messages are not filled in completely for all test cases
my js code works fine in my pc, but in my attempts I get 7 is not turning TRUE, 7 shouldn't be consider a narcisitic number acording the definition given but browsing the internet I've just found for some reason all 10 numbers from 0 to 9 are considered narcisitic...
Loading more items...