Ad
  • Default User Avatar

    The preprocessor statements:

      
      #include <string>
      #include <cctype>
      #include <algorithm>
      
    

    They might not appear in the original comment, so I wrote them here.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    @KirinCupr: just a quick confirmation - you're completely right, the creator of the Kata has defined "input_str" as a constant here, so while we can read its value, we must not change/manipulate it! ... The C++ documentation says about the use of the keyword "const": "an object whose type is 'const-qualified', or a non-mutable subobject of a const object. Such object cannot be modified: attempt to do so directly is a compile-time error ..."

  • Custom User Avatar

    Hello. I'm think we create new variable because "input_str" is is const (const std::string& input_str). So we can't change it. If I'm wrong, please, correct me.

  • Custom User Avatar
    • missing sample tests with consecutive uppercase letters.
    • no actual description of the process
    • the note about spaces has nothing to do here (or it relies on what the author had in mind for the implementation, which would imply the problem is totally undeerspecified as well as undertested)
    • to close to a lot of already approved kata

    => unpublishing.

  • Custom User Avatar

    Interesting, a part of the puzzle is in examples and the other part is in testcases

  • Custom User Avatar

    Hello, how i can suggest contribution with kata description?

    I think to change alcohol description subject to education relevant and neutral subject.

    Thanks.

  • Custom User Avatar

    Fixed.

  • Custom User Avatar

    IMHO figuring out is a major part of this kata. It's tagged puzzle.

  • Custom User Avatar

    Cool kata, congratulations.

  • Custom User Avatar

    Seems absurd that the average rank for this is 6kyu. This is like a 7kyu, tops.

  • Custom User Avatar

    This kata is way too easy and loose it's a bad challenge. It also has other problems.

    • 35 chars is so loose it feels like some form of... shitposting? If you're making a code golf kata you'd at least want the limit to be tight enough to pose a challenge
    • kata doesn't test that every array element should be a distinct array (at least I think it should be)
    • code length check is wrong; see how others do it properly in other "one line xxx" or "xxx line task" katas
    • No random tests

    Moral of the story: Writing a code golf kata needs experience, so don't try this at home, kids, at least not without appropriate skills to do it well!

  • Custom User Avatar

    I actually had in mind always displaying a message, not just when your code is too long. I've edited the test a little - what do you think?

    This also tells dcsmith his code length is not 25 but 14, because the function name isn't counted.

    Counting like that, 35 characters suddenly seems quite generous BTW.

  • Default User Avatar

    done

  • Custom User Avatar

    Alternatively, you could relax the limit.

    Of course there is a shortest solution, probably only one.

    Are you interested in getting the shortest possible solution umpteen times, or people challenging their creativity to come up with different short, but not necessarily shortest, versions? Some people might even submit code that sacrifices some shortness for increased readability (though in this case, the shortest solution is quite readable).

    ETA: the limit as it is does not really need relaxing. see above somewhere.

  • Loading more items...