Ad
  • Custom User Avatar

    Please specify that it's only about ASCII vowels.

  • Custom User Avatar

    You sly cheater! 😜
    But indeed, the test suite should be improved so that your solution is rejected.

  • Custom User Avatar

    I don't like that there's a column named id and no mention of it. It disables the solution starting with SELECT love.*,.

    As a general remark, adding SQL-specific requirements as a comment in the solution template is a practice with poor usability. I suggest Codewars let translations (as well as original kata statements) consist of the universal part and a language-specific one.

  • Custom User Avatar

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

  • Custom User Avatar

    The specification doesn't say which way the cycles should go. If they were reversed, that would also be a correct solution, yet probably failing the tests.

  • Custom User Avatar

    What @Dmitry-k42 described is actually an issue. Category names are used in the tests not only for tie breaking at the last (5th) places, but also for ordering the otherwise tied rows in the result. See my solution. The description (updated after @Volie's issue) requires the "name" in the inner ORDER BY clause, but not the outer. Yet, the order of such rows is arbitrary without it, which may fail your tests.

  • Custom User Avatar

    Even the random ones somehow have never hit this case for me.

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    I can explain. Unfortunately, quality checking on Codewars is poor, people can rate katas and raise issues, but it's up to the author's ability to understand what's wrong and their good will (which they may lack even if they clearly understand and know how to correct, having been politely informed – happened to me, so I don't want to do it anymore until the Codewars team come up with some improvement to the process (I do have some ideas) (but unlikely, as they have serious issues reported on GitHub and unsolved for almost 10 years, like the one that you can try to see your friend's or your own solution which definitely exists (as shown by Codewars elsewhere) but it's not there)). One of the most common problems is that tests test for too little (and often also too much) and allow much easier incorrect solutions to pass. (One of my ideas: allow others to write tests and earn honor points thereby, with some verification, e.g. by some supermajority of votes, perhaps weighted by voters' honor (a ninja could use proposed but yet unverified tests as an option, not required to pass the kata, but potentially useful).)

  • Custom User Avatar

    This isn't guaranteed to work. For sort to return a permutation of the elements to sort it's required (per https://tc39.es/ecma262/multipage/indexed-collections.html#consistent-comparator) for the passed function to be a consistent comparator. One of the conditions is that 0 must be returned when the same argument is passed in both position. With yours it's -1 when a and b are 0.

  • Custom User Avatar

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

  • Custom User Avatar

    Yes, it works now, thanks!

    By the way, the test suite (including basic and random) seems to always give strings starting with a letter to encode. From what I see in the solutions, some people assume it (as did I up to the moment I realized the desciption didn't guarantee it, so it's required to handle the other case too), some don't. I imagine you wouldn't like (or even be able to, depending on how Codewars works; I don't know, I haven't created any kata yet) to invalidate those solutions, so maybe add this condition to the description.

  • Custom User Avatar

    The random tests in Scala give data like this to decode: List( _ (cpofnp * (, cpaple 20 1000, )) LctesxpetnP, inpaetzy tyepr, pc zgpcqwzh ). This is impossible – you can't get it from encode, the first 2 characters are always letters.

    Also, adding a sample test in which the data to encode doesn't start with a letter (but contains at least one, which is one of the many implicit conditions the kata description entails) would be prudent IMO.

  • Custom User Avatar

    Imagine me saying in my best attempt at a Vulcan voice: "It's adequate" 🖖

  • Loading more items...