Ad
  • Default User Avatar

    Please read posts below. The question has been put and answered many times.

  • Default User Avatar

    Test Case Number 2:
    WHY ==> 'Elizabeth' should equal 'Matthew'
    i am calculating their values to be both 485, so alphabetically is Elizabeth 1st.
    i am getting 66 Passed Tests and 2 Failed, both same case as this.

  • Custom User Avatar

    For me it is. Thanks.

  • Default User Avatar

    OK. I hope it's correct now:-)

  • Custom User Avatar

    That's better, one last thing I would change is make all PauL's the same capitalization.

  • Default User Avatar

    See above.

  • Default User Avatar

    Description modified. Could you have a look? Thanks!

  • Custom User Avatar

    Rename the partial value of the instructions to something else, n is already used as a function's argument and that's a little confusing.

    The length of the firstname is added to the sum of these ranks hence a number m. An array of random weights is linked to the firstnames and each m is multiplied by its corresponding weight to get what they call a winning number.

    Something like that or whatever name not used in another part you want would be fine.

  • Custom User Avatar

    There are two ns there, one should be renamed.

    The length of the firstname is added to the sum of these ranks hence a number m. An array of random weights is linked to the firstnames and each m is multiplied by its corresponding weight to get what they call a winning number.

    Like that ^.

  • Default User Avatar

    Hi, I'm definitely missing something, so could someone please clarify? -
    If n is calculated by the first name length + rank of each letter in the name, why is n provided as an argument in the function?
    I would think we would get the string argument, weights argument and then calculate n ourselves, using it to calculate the 'winning number'...
    Thanks for your help

  • Default User Avatar

    toofarm, can you explain what you changed? I really don't get what flipped expected values mean. Why would my code work for all sample tests and then fail for every random input.

  • Default User Avatar

    Same here, returns and logs correctly on my machine, but returns 'undefined' when attempting.