Ad
  • Default User Avatar

    There needs to be a better way for newer solutions to get upvoted.

    I feel that some of my solutions are done better than some of the top voted solutions, but I'm at the end of the pile behind everyone and their mother who just started learning (no offense, this is a learning environment which I support). So no one will look at my code and upvote/comment/critique.

    It would be so much better if solutions could be sorted by runtime or overall efficiency, instead of upvotes.

    Thanks!

  • Default User Avatar

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

  • Default User Avatar

    You are making the mistake of saying that strings can't be iterated without converting to list.

    You can already do roman[::-1] perfectly fine on any string. Strings are essentially an array from characters. You have C to thank for that.

  • Default User Avatar

    Top rated algos are more complicated than needed...

    I'm surprised as to how the top rated is... well... the top rated.

    Please check out my algo for a much cleaner and KISS implemented algo, and rate if you can.

    Roman Numerals Decode KISS algo

    Thanks

  • Default User Avatar

    My solution overall satisfies the conditions that the cache be only accessible to the function itself. But I did not use memoize. I didn't even realize what they were talking about, so I just did the next best thing, pass by reference. Well, not exactly passing by reference, and I can see it taking up some memory for larger calculations. However I think it's really good for a solution. Check it out

  • Default User Avatar

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

  • Default User Avatar

    I found this problem to be more or less a test on time.

    Where the most popular algorithm is neat on one line, I wouldn't ever user in production code unless I'm sure the values are less than 10,000.
    The code I made is O(log_2 n)

    Then again, I work in iOS and pc gaming applications, so thinking of quick to execute code is something I gotta do.

  • Default User Avatar

    Really? Hmm, I suppose I should look up how exactly *args and **kwargs is interpreted.

  • Default User Avatar

    I like this the best. My solution was a single line as well, but I think this is perhaps the best way to do this. I didn't realize you could separate the arguments in this way. Good to know for next time!

  • Default User Avatar

    I don't like this solution. It implies that there will always be 2 parameters. Although it does work, it doesn't really fit the bill for scalability IMHO.

  • Default User Avatar

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