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.
OP solved it, closing
this is due to input mutation
How to return imaginary roots?
Yeah realized that now...Thanks
This comment is hidden because it contains spoiler information about the solution
Good example; if I can re-publish the kata I will put that in the description. Thanks!
Hi g964,
The clarity of the kata's description could be improved by giving it a real life example such as.
"Bob is using a typewritter to type all the squares of numbers from 1 to n. Write a function which returns the number of times he hit a particular key from d (between 0-9) in order to complete his task."
This comment is hidden because it contains spoiler information about the solution
Your code fails for any single digit input (e.g. n=
5
). This is because your reduce function tries to take two arguments (x and y, representing the digits) however the input is one digit long and the second argument doesn't have value, therefore it returns the first value as a string. It produces an error fromm/10
because it is trying to divide a string.Your transformation from string to number does not work.
In the array there could also be negative numbers! Thats the '-'... ;-)
I hope that helps.
This comment is hidden because it contains spoiler information about the solution
All Katas have an automatic discourse page. All you have to do is click the "Discourse" button from the "Details" tab that you start on. Or you can add /discuss in the address bar after the Kata. Here is the link you want: https://www.codewars.com/kata/sorting-on-planet-twisted-3-7/discuss/.
From here you can create your own comment thread (you can give a suggestion, report an issue or ask for help) or you can reply to someone's comment by clicking the "Reply" button.
Hey,
To choose "Kata" on the left side of the site. Search for the kata you want to solve. Then click on the kata. This will open a page with the problem statement. Beside the name of there is an option called "Train". That is the option for solving the kata. Hope that helped. Cheers!
Hey guys, I'm new here. There is 6kyu kata called sorting on planet twisted 37. How do I start a discourse page on that kata? Thanks!
Welcome to Codewars!
Your code returns string (proof ->
<class 'str'> should equal 0
) when the expected outcome should be an integer. Simply cast the string -> to integer.To post your code in a comment with indentation, use three backticks (`) at the beginning and end of your code - see here for more details.
Loading more items...