Ad
  • Default User Avatar

    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.

  • Default User Avatar

    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?

  • Default User Avatar

    Just a note, this solution (as many others) has side effects: it modifies the list nums.

  • Default User Avatar

    FYI: this does not work with Python 3 with elements of int and str mixed in the array.

  • Default User Avatar

    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.

  • Default User Avatar

    Added example for Python.

  • Default User Avatar

    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?)

  • Default User Avatar

    'Best Practices' +1 because of the use of context managers!

  • Default User Avatar

    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.

  • Default User Avatar

    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!

  • Default User Avatar

    Needs harder test cases, and more description text, but generally I like it.

  • Default User Avatar

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