Ad
  • Custom User Avatar

    Tested with timeit 100000 iterations:

    using a loop = 0.009008507011458278,
    using all(list comprehension) = 0.04262416099663824,
    using any(list comprehension) = 0.04675498099823017.

  • Custom User Avatar

    closing

  • Custom User Avatar

    not an issue or fixed

  • Custom User Avatar

    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.

  • Custom User Avatar

    The solutions with all works in a similar manner

  • Custom User Avatar

    Expected and actual params in the fixed tests were flipped. Fixed.

  • Custom User Avatar

    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.

  • Custom User Avatar

    If you look at the example I try to show what I mean. Say you have an image:

    A B C
    F G H 
    K L M
    N O P
    

    G and L 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 with A the other neighbors in relation to the whole image (besides B, F, and G) will look like:

    A A B
    A A B C
    F F G H
      K L M
      N O P
    
  • Custom User Avatar

    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.

  • Custom User Avatar

    I've updated the colour to the same colour Codewars uses. :-)

  • Custom User Avatar

    Not a problem. Is the yellow still too bright? or the white?

  • Custom User Avatar

    Hi @mywtfmp3, is that better? please let me know if the new colour of yellow looks better and I'll updated all my katas.

  • Custom User Avatar

    I had the same problem. Notice in the description of the problem that the result should be:
    "(rounded up to the next integer)"

  • Custom User Avatar

    Which intention do you see behind?:-)

  • Custom User Avatar

    Description says:

    return a positive integer unless conditions are not fulfilled in which case return -1

    If bounce == 1, conditions are not fulfilled so return -1.

  • Loading more items...