Ad
  • Custom User Avatar

    Hey guys,
    what do you think about that method?

  • Custom User Avatar

    What could make my Javascript code pass all the basic tests and fail all the random tests? :-(

  • Custom User Avatar

    Note: Your function should modify the input rather than creating a new array.

    ^ That

  • Default User Avatar

    in JS
    on console.log(res) I see a rigth answer, but return same result in function take a error and show nonchanged (arr)

  • Default User Avatar

    exp =
    AB

    • BB

    = 2079
    Expected: ''27 * 77 = 2079'', instead got: ''63 * 33 = 2079''

    Both results are correct. And in first test
    ABC

    • CBA

    = 39483
    Expected: ''123 * 321 = 39483'', instead got: ''321 * 123 = 39483''
    also both results are correct. Сan be excluded from tests examples that have an ambiguous solution?

  • 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

  • Loading more items...