Ad
  • Custom User Avatar
  • Default User Avatar

    Correct me if I am wrong: the String.split will find the pattern, remove it and keep left and right side.
    So every 2 chars, split will remove pattern, keep left side (just got removed) and right side.
    The trick here is that thanks to the capturing groups (?<=) + \G, pattern is reinserted(?) or pattern becomes "what's in between 2 chars" (?).
    Still trying to figure it out.

  • Default User Avatar

    "Once one knows the language" Thats the entire reason why i do these. First I solve them just making it work (Python), and then i look at the solutions of the pros and feel like an idiot, but it gives me real world exapmles of how to actually use the conventions of the language versus trying to do everything the way id have done it in another language. And I dont have to try and create code for a useless program and not have any idea if I could have done it more efficiently. Idk if that makes sense.

  • Default User Avatar
    • ranks cannot be changed
    • old katas are generally overanked
  • Default User Avatar

    There are special Function and Stream implementations for int:

    • Stream<Integer> --> IntStream
    • Function<Integer, Integer> --> IntUnaryOperator
    • Predicate<Integer> --> IntPredicate

    The assertion message should specify exactly which year failed the test and not a general "Your function gave a wrong result on one of the inputs." So do the assertion directly where you check the solution for a single input and not assertTrue(allMatch().

  • Custom User Avatar
  • Custom User Avatar

    Hey,

    Don't let just one kata discourage you. I've been programming professionally for six years and would find this Kata difficult. Not sure what type of programming you do but these kind of challenges aren't reflective of most day-to-day programming that most people do :)