Ad
  • Custom User Avatar
    • I don't care too much about "preferred way",

      • And I do not care too much about your preferred way. Language-agnostic descriptions are encouraged on Codewars, deal with it.
    • There's not much that leads to "maintenance issues" with that.

      • You do not know about maintenance issues, because you do not maintain your old C/C++ translations (which have quite a few issues. I know, because I have had too fix and maintain a lot of them, many having very poor design, writing C++ like it's 1998 with pointers all over the place, no instructions on memory allocation, poor assertion messages and uncomprehensible, golfed code in the test suite. It's really revolting to see you complain when the tiniest thing in a kata does not go your way, while you authored all this mess and are never going to fix it.). So do not bring up maintenance when you are not the one maintaining things.
    • Clearly the function off doesn't return an array at all

      • Which is to be expected for a C kata, since passing arrays as output parameters is idiomatic in C.
  • Custom User Avatar

    Once again, you erase the instructions in the initial code without reading them, stop doing that. Per-language instructions are supposed to be in there on Codewars, as putting them in the description leads to maintenance issues. This is the preferred way to do this and has been for quite some years now, get used to it.


    The API is not strange. You have a buffer of length n, write your answer to it and return the actual length of your answer (which will obviously be <= n as per the problem statement, since you are removing elements in a list of numbers from 1 to n). All of this is explained in the initial code.

  • Custom User Avatar
  • Custom User Avatar

    duplicate of this issue

  • Custom User Avatar

    Fixed Coffeescript and Ruby too.

  • Custom User Avatar

    Javascript, that seems to be the original language generates arrays without repetitions, so,
    I've fixed Python translation to do the same, I think other languages should be checked as well, just to be sure.

  • Custom User Avatar

    So, do you think adding monotonically would make it better? Or changing ascending for non-descending and viceversa? The other way to resolve this, would be making sure there are no repeated numbers in each of those arrays. At least in Python, there is no guarantee that the lists don't have duplicates in random tests.

  • Custom User Avatar

    Why do you say it's not sorted? Because it is, it's not strictly descending, but it is descending.

  • Custom User Avatar
  • Custom User Avatar

    Description wasn't updated, but max testing input was.

    Problem now is the naive implementation ( sometimes ) passes in time.

  • Custom User Avatar

    Yes UB indeed, I just went with obfuscation mode. (-:

  • Custom User Avatar

    this is the same in the Python version, because this kata is a puzzle

  • Custom User Avatar
  • Custom User Avatar

    description now states:

    If an index is beyond the string, it should be ignored.

  • Custom User Avatar

    Yeah, I’m a pretty weird dude. I have an entire list of various sayings, quotes, and aphorisms from different people and languages. I'm pretty sure that particular one comes from a Latin book I have called Sententiae by Publilius Syrus. Most of the Latin ones I use are from him. He has a ton of good ones. You should check it out.

    Yes, I’ve learned quite a few tricks from Code Golf on Stack Exchange. That said, I don’t post there like I do on Codewars. I just really enjoy trying to find the shortest C solution possible for each kata. It’s not just about code golf though, sometimes it’s about finding something equally as clever, like using shellcode tricks or inline assembly.

    It feels like I’m always learning something new from someone’s unique solution. That’s really what I love about Codewars. But you’re totally right, I should visit Code Golf SE more often.

    “Aliquid semper addiscendum est.”

  • Loading more items...