Ad
  • Custom User Avatar

    I also agree with you.

  • Default User Avatar

    I had posted this as a separate suggestion and then realized it was basically the same as this one:

    "I'd really like to have the solutions section display the duration that each solution took to execute. I've had to rewrite code a couple times because codewars said it took too long to execute, so it seems to be tracking time.

    I'm very new to coding in general and have only been working my way through Python so far, but I learn a ton by looking at other people's solutions. I've also learned that I can't always trust what is marked as "best practice" or "clever" to actually be GOOD.

    I can determine readability on my own and I think that's a pretty subjective thing. I sometimes go run other people's solutions to see how they work and how efficient they seem. As far as I can tell, readability and efficiency are the two most important things when differentiating valid solutions to a problem. A display of how much time a solution took to execute (or some other metric for efficiency if something else is better) would help me learn a lot."

    Voile, in seeing your answers I still think that a runtime display would be really helpful. Memory usage would be neat as well. Maybe I don't understand what a code length metric would mean, but can't we visibly see how long the code is? You mention difficulty of benchmarking random tests, but couldn't you just display runtime metrics for whatever the set tests happen to be?

  • Custom User Avatar

    Why are you so resistant on one-liners and code golfs? ;-)

    It's not like we're actually trying to golf most of the time (or you'll be seeing really horrible things). We're mostly just reducing the unnecessary burden and bloat in the code, keeping everything concise and to the point ;-)

  • Custom User Avatar

    I think I agree and just suggested a "readability" vote in addition to "clever". I'm tired of seeing the top solution be a one line. This isn't code golf, is it? :(

  • Custom User Avatar

    If we're adding in metrics we'll at least add 2 more metrics: code length and memory usage. Even a typical OJ site will have these 3 metrics.

    It seems like you've fallen into the Leetcode trap aka the classical interview problem trap, thinking that efficiency is all that matters. It's not. Besides efficiency, code length and memory usage, there are also readability (yes, being concise is one), elegancy, time required to code a solution, etc. These things are subjective and you can only rely on (educated I guess) people to vote on things that are actually readable and elegant, and not just "things that look like typical Java code".

    Also, a kata is ranked and judged by how the tests are written. If it's written such that even algorithms with a very bad efficiency passes, they pass. Just like in any OJ sites, if you get an AC, nobody cares if you used a brute-force approach ;-)

    p.s But it's all pointless anyways because unlike in other sites, we require random tests, and when you have random tests it takes a lot of time to benchmark to a precision that can resolve one solution from the others if they're very close. (Yes, benchmarking is hard).

  • Custom User Avatar

    Even when discussing solutions, mark your post as having spoiler content (when they have it ofc), they're visible in the home page otherwise.

  • Default User Avatar

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

  • Custom User Avatar

    Not sure if Python optimizes a bit when it works on whole strings compared to taking each character one-by-one, but you definitely make a pretty good point: thanks :)

  • Custom User Avatar

    Are you printing some value to the console?

  • Default User Avatar

    I thank you very much!