Ad
  • Custom User Avatar

    Oh I see, my code returns 25 :V yea my logic is wrong. Thank you very much for your help :)

  • Custom User Avatar

    That test is comparing the result of running your code to 26 and it is not so the test is failing. I suggest adding print statements to check what your code is returning.

  • Custom User Avatar

    [ C ]
    Hi everyone,
    My code fails in the following case:

    "The expression (duplicate_count("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz")) == (26) is false."

    I don't figure out why 26 is "false" since each letter is repeated from 'a' to 'z' and consists of 26 letters.

    Help :V

  • Custom User Avatar

    Because of number of letters.
    If you just sum ASCII numbers for each letter in a word "aa", you'll get "97 + 97" = "194", in the same time for word "w" you'll get "119", i.e. "194" > "119".
    It's a wrong answer.
    According to the task, you should consider letters position in the alphabet: a = 1, b = 2, c = 3 etc. : so you supposed to get for "aa" -> "1 + 1" ="2", and for "w" -> "23".
    "23" > "2". The correct answer is "w".

  • Custom User Avatar

    The same doubt for me ...anyone explain this if you know the answer

  • Custom User Avatar

    oooh! I see :v
    Thanks.

  • Custom User Avatar

    Read stephane777's post below, it's been explained several times before. Tests are ok. You're not following the instructions.

  • Custom User Avatar

    [ C ] Hi!
    I can't figure out why "volcano" is higher score than "climbing".
    I got the following result highestScoringWord("what time are we climbing up the volcano"); :
    "volcano" scores = 754
    "climbing" scores = 837
    So "climbing" should be the highest scores but the test expected is "volcano".

    Halp :v