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.
Fixed with latest fork. A specific description is not required since that is the purpose of the stub code in initial solution setup provided and also sample tests
Fixed in latest fork above
I've made a fork here that adds the signature to the solution setup code. Making the solver guess what the type signature should be is completely out of the scope of this kata.
Missing following tests
[]
[0]
in
Dart
Java
Lua
Python
Scala
No fixed tests in Clojure
This comment is hidden because it contains spoiler information about the solution
Description:
But there are no empty arrays in the tests. That's too bad. Because in this case solutions with reduce would not work.
The reason of your problem is that you mix up, and seem to miss the difference, between numbers and digit characters. When you do
odd = [1,3,5,7,9]
, then the listodd
contains 5 numbers: 1, 3, 5, 7, and 9. When you donumber = list(str(sum(arr)))
, thenumber
list holds characters, for example:'1'
,'3'
,'5'
,'7'
, or'9'
. That's why when you donumber[-1] in odd
you get no results: because for example'5'
is not in[1, 3, 5, 7, 9]
.5
is, but'5'
is not. You need to find out what's the difference between'1'
and1
, or between'7'
and7
.Thank you for the solution
This comment is hidden because it contains spoiler information about the solution
Because it is not correct.
Without seeing your solution we do not know why it is not correct.
Why my solution doesn't work?
I disagree, checking a number's parity is 8 kyu, checking the parity of the sum of all elements in an array is 7.
too easy for 7 kyu
Thanks!
Loading more items...