Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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!
This comment is hidden because it contains spoiler information about the solution
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.
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
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
This comment is hidden because it contains spoiler information about the solution
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.
Really? Hmm, I suppose I should look up how exactly *args and **kwargs is interpreted.
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!
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.
This comment is hidden because it contains spoiler information about the solution