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.
Tested with timeit 100000 iterations:
using a loop = 0.009008507011458278,
using all(list comprehension) = 0.04262416099663824,
using any(list comprehension) = 0.04675498099823017.
closing
not an issue or fixed
It's a very strange proposition for a kata. I, too, came to search the comments for an explanation!
I almost didn't want to to do it because it felt so artificial, like something I would never actually want to do. Lots of people rated this highly, however, and I DO want to do it, just... not sure which language to choose at the moment.
The solutions with
all
works in a similar mannerExpected and actual params in the fixed tests were flipped. Fixed.
It's not broken, you just aren't accounting for padding.
The random tests are encoding it, then decoding. However due to the way it encodes, strings who's length is not divisible by 4 will have padding added in encoding.
If you look at the example I try to show what I mean. Say you have an image:
G
andL
are the only pixels with 8 neighbors present but each pixel still needs 8 for the filter to work.A
only has 3, so the other 5 have to come from somewhere else; for this algorithm you should use the edges/corners own values. So withA
the other neighbors in relation to the whole image (besidesB
,F
, andG
) will look like:I thought it's clearer this way, I don't think codewars language has any approximately equals thing, and it's a bit unreadable. All random tests do the rounding to 6 places.
I've updated the colour to the same colour Codewars uses. :-)
Not a problem. Is the yellow still too bright? or the white?
Hi @mywtfmp3, is that better? please let me know if the new colour of yellow looks better and I'll updated all my katas.
I had the same problem. Notice in the description of the problem that the result should be:
"(rounded up to the next integer)"
Which intention do you see behind?:-)
Description says:
If bounce == 1, conditions are not fulfilled so return -1.
Loading more items...