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.
Maybe check this article: https://docs.codewars.com/training/troubleshooting/#print-input
There is an issue in this kata the test cases run smoothly but when I click attempt it says should work for n = 0 or something above those lines. I tried using and if statment then it says +0 should equal 1 when I change it to return 1 it says 1 should equal 0. I don't know how to debug this. this is the only test cases that isn't working.
For anyone wondering, this is definitely and absolutely NOT best practice! Its not even a clever solution.
5 years old issue is still not resolved. Bad kata
Approved
python new test framework is required. updated in this fork
Your code will compare numbers against itself (which fails for cases when
n = 0
) since the diff between a number and itself is always0
Your solution does not take into account cases like
arr = [8, 4, 0], n = 4
. The expected result should be2
, but your solution returns0
Use single quotes unless string interpolation is required.
the spread operator didnt always exist.
I think I did this efore the spread operator existed. So ...args wasn't valid.
This comment is hidden because it contains spoiler information about the solution
Approved
Loading more items...