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.
it shifts right a number of times, then it shifts left a number of times. basically the bit shifts cancel out to i << 1 in the end
tasty code
You just have to say its an memory optimized solution and not a time optimized :)
This code looks ... shifty.
breth·ren
brother
delete?
What's going on here
uh
homie did the problem in one line
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.
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.
What a effizient way to solve this problem
You could ask for help on the Code Wars discord chanel. Or you could msg me on discord and I will help you Yanni#6959
kata += x
: warning with that one: if you go that way you'll have to specify if the user has to mutate the current instance or not.x + kata
: this one is "especially" interseting in the string case.Loading more items...