Ad
  • Custom User Avatar

    Corrected regex compared to my previous solution, which didn't handle 6 consecutive separators correctly (now, it does).

  • Custom User Avatar

    In fact, the regex should be "(\W|\w+)+?", I just realised this by myself (too late), otherwise 6 consecutive separators in the input will be shortened to the word "4", however this is an edge case, which the test cases don't cover.

  • Custom User Avatar

    For me, this is a huge wtf xD
    This is not grandma's average Java code ...
    Nice effort dude !

  • Custom User Avatar

    I found the usage of "modern" java features rather creative for this Kata, but I find the readability took a serious smash in the face. Good job anyway !

  • Custom User Avatar

    Thanks for the honest answser, it's really appreciated. "Horrifying" is a strong word after all, sorry about that ^^" I do understand these Kata's are only exercises :) However when you say "you know your parameters and they won't change"... I dearly hope that is the case for you if you're a professionnal programmer, because where I work, the client changes his mind every 5 minutes and thinking ahead has become a second nature for me, and I can never take his word for granted on any requirement what so ever -_-"

  • Custom User Avatar

    This solution doesn't handle this case properly : "an invalid sequence (a string with non numeric character).
    Using input data "1 a" returns 0 instead of 1.

  • Custom User Avatar

    Not OOP design, but still trying to be both generic and understandable.

  • Custom User Avatar

    Add a 4th type of bill and you will have to rewrite the whole method, because the logic varies directly according to the bill value. I believe this is wrong design. Am I the only one this type of solution horrifies ?

  • Custom User Avatar

    Finally a solution which goes the generic way ! I love it ! The value-specific logic proposed in most solutions horrifies me to no end ...

  • Custom User Avatar

    Not with modern versions of the java compiler. They now tend to automatically replace string concatenation with a StringBuilder and multiple append(String) calls on it at compile-time.