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.
I'm not saying the solution is not valid - it gets the job done alright, there's nothing wrong with that, especially for a one-off script :)
However, it makes assumptions (number consisting of 1s and 0s only --> number is binary), while disregarding information given (currency starts with consonant --> conversion rate has been tampered with).
That's why I would not consider it as best practice.
This works with the given CONVERSION_RATES as far as I see, but it would falsely assume a number is binary even if the rate is legitimately made up of only ones and zeroes in decimal system.
This is not best practice IMHO, or am I missing something?
Just a note, this solution (as many others) has side effects: it modifies the list nums.
FYI: this does not work with Python 3 with elements of int and str mixed in the array.
User test cases pass for me.
I set
rotn = decode
, since I suspect you used that name in your tests (and it looks like that is the case), but the test still fails; it seems you pass a list instead of a string, yet you make no mention of that in the description.Added example for Python.
A minor detail: function names in Python (or just about any language) should be lower case (see PEP8 style guide).
Also it could be clearer what should be shifted (only letters, or numbers as well?)
'Best Practices' +1 because of the use of context managers!
More tedious than it looked at first glance. The duplicated parameter 'b' has different values in a test, I had to guess which one needed to be kept.
Very nice kata!
Challenging and requires you to have a good grasp of the language, data structures and algorithms. It was very satisfying when my solution finally worked!
Needs harder test cases, and more description text, but generally I like it.
This comment is hidden because it contains spoiler information about the solution