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
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.
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 list odd contains 5 numbers: 1, 3, 5, 7, and 9. When you do number = list(str(sum(arr))), the number list holds characters, for example: '1', '3', '5', '7', or '9'. That's why when you do number[-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' and 1, or between '7' and 7.
I feel like it lacks a test for values exceeding limit for given int type.
bro, to make your comment readable take a look on this docs : https://docs.codewars.com/references/markdown#displaying-code
could not figure out why my code was not passing this one test case... maybe some rounding error somewhere, but could not find it. feedback welcome
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?
Loading more items...