Ad
  • Default User Avatar

    Issue unclear.

  • Custom User Avatar

    No, the ROT13 alphabet just displaces all characters in the regular alphabet by 13 places: "NOPQRSTUVWXYZABCDEFGHIJKLM"

  • Custom User Avatar

    Function name fixed.

  • Custom User Avatar

    im also having this exact problem, can you shed any light on it? using java

  • Default User Avatar

    Good work!-)

  • Custom User Avatar

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

  • Custom User Avatar

    Could you post exactly between 3 backticks the test?

  • Custom User Avatar

    Well as the problem was just to return only one winner, I just evicted duplicates, which doesn't allow the other problem where you would want to return an ordered list of "winners" (?)
    If that was the case, I would obviously choose another method to keep my results ordered (maybe an OrderedDict like you did)

  • Custom User Avatar

    scores only store the first candidate for each total score when iterating candidates, which is ordered, and so the order is "preserved" as I evict all duplicates (look at the setdefault method usage)

    Maybe I shouldn't have used a dictionnary for this and just stored a winner variable updated when seeing a candidate with a better score, this would have been easier to read I think.

  • Custom User Avatar

    Second point in the description:

    If v is ommited, fill the array with undefined

    You function needs to have default for the second argument as some of the tests would be like prefill(n).

    Of course, in python, None would be used instead of undefined as the default argument.

  • Custom User Avatar

    I am confused about this too. It would be useful to see the test case.

  • Custom User Avatar
  • Default User Avatar

    In Python, it is even a built-in feature.

  • Default User Avatar

    The rot13 just means an alphabet with 13 letters in it. This test tests your code for the following note in the description:

    -The function must work for any arbitrary alphabets, not only the pre-defined ones.

  • Default User Avatar

    @re4lfl0w: I thank you for all your kind answers that I appreciate very much! I think I will not change the description because:

    first - one shouldn't think from the example in "corrected order" that the arrays a and b will always be given sorted in the tests.

    second - one must understand that same in the description doesn't mean ==. 11 in a in kind of same as 11 * 11
    in b but they are not ==, etc... It's clearly said in the first sentence of the description that

    "Same" means, here, that the elements in b are the elements in a squared, regardless of the order.

    I hope that everything is now clear for you. Don't worry about this "accident"! It happens that sometimes people don't measure the weight of their words. Good luck!

  • Loading more items...