Ad
  • Default User Avatar

    I'm glad it helped :D

  • Custom User Avatar

    In example tests function vodkaConsumption was calling twice on the same array.

    var example = ["40ml","5.5l"];
    
    Test.expect(vodkaConsumption(example) == "5540ml" || vodkaConsumption(example) == "6l");
    
    

    In your solution you have change array values to integer which doesnt have "indexOf" method.
    Im not an expert but arrays are pass into the function as reference so if you change passed array inside the function you affect that array outside that function.

    I have update test cases.It got me some time to figure it out.You can send your solution now.
    Cheers!

  • Default User Avatar

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

  • Default User Avatar

    I pass all the cases, I just get an error:

    Value is not what was expected ---> how can I possibly know what this is?

  • Default User Avatar

    What are the rotors for the multi-line test cases? That should be given so we can troubleshoot.

  • Default User Avatar
  • Default User Avatar

    Great, you got it! Made minor alteration to my code and it now passes.

  • Custom User Avatar

    I figured it out. It's fairly simple, it's asking for the highest sequence of five numbers within the code (without rearranging it).

    Good luck

  • Custom User Avatar

    Look at my suggestion above. they're asking for the highest sequence of five numbers, not for you to re-arrange it and find the highest numbers within the argument.

  • Custom User Avatar

    I figured it out, here's what I wrote:

    For everybody who gets 99999 instead of 99890, here is some help:

    THE INSTRUCTIONS ARE VAGUE. Here is an example, let's say they gave the number: 9834775899890938471234

    At first, I initially understood it as re-arranging all the numbers and finding the highest numbers within that.
    In this case it would be "99999".

    But it's actually asking for the highest SEQUENCE of 5-numbers in a row.
    In this case, it would be "99890".

    That is the difference, and I got it right. I hope this helps.

  • Custom User Avatar

    For everybody who gets 99999 instead of 99890, here is some help:

    THE INSTRUCTIONS ARE VAGUE. Here is an example, let's say they gave the number: 9834775899890938471234

    At first, I initially understood it as re-arranging all the numbers and finding the highest numbers within that.
    In this case it would be "99999".

    But it's actually asking for the highest SEQUENCE of 5-numbers in a row.
    In this case, it would be "99890".

    That is the difference, and I got it right. I hope this helps.

  • Custom User Avatar

    Same issue... Did you guys figure it out?

  • Custom User Avatar

    I understand your question and I have the same problem.

  • Custom User Avatar

    "99999" isn't included as substring in the input number (string), so your result is wrong. "99890" is included and it's the highest value of all 5 digit substrings, so it's the correct solution for this testcase (don't understand your question, but hope it helps;-))...

  • Default User Avatar

    I know some other people are experiencing this too. I don't understand how my code could be incorrect with the following error message.

    solution did not return correct value - Expected: 99890, instead got: 99999

    If my code returns 99999, then wouldn't that mean the largest 5 digit number (from the same group of digits that contains the expected "99890") is actually 99999 ?

    Please HELP!

    p.s passing everything else, and works for me locally, have tried a lot of different tests.

  • Loading more items...