Ad
  • Custom User Avatar

    In Rust, you don't need to insert every pair into the map manually. Just use:

    use std::collections::HashMap;
    
    let events: HashMap<_, _> = [
        (99, 80), (95, 75), (92, 88), (89, 68), (74, 53), (64, 60), (62, 19), (49, 11), (46, 25), (16, 6), // snakes
        (2, 38), (7, 14), (8, 31), (15, 26), (21, 42), (28, 84), (36, 44), (51, 67), (71, 91), (78, 98), (87, 94) // ladders
    ].into();
    
  • Custom User Avatar

    Pretty kata. But I would probably rate this ont as 5 kyu, not 6. And also please consider adding OOP tag to this one

  • Custom User Avatar

    Updates tests to latest PHP setup, adds missing <?php directives.

  • Custom User Avatar

    Nice challenge!

  • Custom User Avatar

    Enabled Ruby 3.0 + RSpec

  • Custom User Avatar

    This could be fun, but 7 is harsh for how tedious it is... why are months text and different format on top? Without htat my only gripe would be about the dynamic allocation in C, but it is too tedious for 7. Which is a shame, because overall it is a really nise puzzle to solve.

  • Custom User Avatar

    C#:

    • the method should be static, as the class holds no state. Since this is a breaking change, might as well:
      • change its name to be in PascalCase as is usual in C#
      • remove the useless namespace CodeWars
  • Custom User Avatar

    fixed, and added a return value so that it compiles

  • Custom User Avatar

    as said by udovr above, Array(6).fill(Array(7)) will set every row of the matrix with the same reference to a single Array(7) object, so mutating one row will mutate the others as well. The canonical idiom to create a matrix while avoiding this problem is via Array.from():

    Array.from(
      {length: rows},
      () => Array.from({length: columns}, () => 0)
    );
    
  • Custom User Avatar

    seems to be OK, too

  • Custom User Avatar

    ruby is fine. how is JS?

  • Custom User Avatar
  • Custom User Avatar

    A good place to ask for help is in the # help-solve channel on the Codewars Discord server. For now, I'll just say: Pay attention to the final hint in the description, and research how to peek into the contents of a Python class (if you don't already know how). I learned a lot about that by banging away at this kata and finally solving it.

  • Custom User Avatar

    Does anybody else find this description to be nowhere even close to sufficient? I have no idea what this is asking me to do.

  • Custom User Avatar

    I wished the description mentioned that months can come in different formats, as seen in the tests. Also, the description part "(7th character incremented by 5 if driver is female" I think it's more easily understood as simply "add 50 to the month if the driver is female".

    If you are struggling with dates in Python, check the module for datetime.

    Overall, fun and good!

  • Loading more items...