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.
resolving
Done, thanks!
Will something like
func([20, 20, 20, 20], 20)
work?You mean in examples?
Thanks!
Sorry about that. I was planning to reply to this comment when I found out that the original solution is incorrect. Couldn't fix it in time, sorry again you had to check incorrect code. Anyway it's all good now. I've updated description, specs and solution
Thanks! Done
Can confirm that as of now Kata is fully working. However use of old version of Solidity along with rather poor tests make it not very enjoyable as it was hard to understand whether the tests were broken or the code.
I also feel like both
assert
andrequire
should work here. And since onlyassert
works it needs to be specified in description@Blind4Basics I don't think that neither ruby code nor codewars is about writing efficient code, rather it's about writting a readable, easy to understand code.
sum
on a string returns a sum of binary values in a string.Range of english alphabet in binary is 97..122 so to convert to a range of 1..26, you need to substruct
96
times the number of chars(x.size * 96
)Hey guys, try this set of test, they should properly cover most of the requerements
One hint for those who is struggling
Tests should check that you monkey path only methods that start with '_'
hash.no_method
should return exception error, most of the current solutions would just try to findhash[no_method]
Yeah, I did. Thanks, didn't know that can be an issue
It seems to me that random tests in Ruby are broken.
In every test expected value is 0 and if you log given string it is clear that 0 is not a correct answer.
return
is unnecessary.Fixnum
has a methodnegative
.-num
will work just as good as0-num
Loading more items...