Ad
  • Custom User Avatar
  • Default User Avatar

    That's a way more elegant method of checking the characters than I did - thanks for teaching me something new!

  • Custom User Avatar

    I like this solution! :D

  • Default User Avatar

    Wow thank you. I have no idea how but it works now!

  • Custom User Avatar

    You did not consider the way back home in the price and you also calculate the price of a full tank when distance is 0. What if distance is 0 but there is still gas in the tank? ;-)

  • Default User Avatar

    I tried changing it to multiply distance by 2 (in order to account for the way back) but then it fails even more of the tests!

  • Default User Avatar

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

  • Default User Avatar

    If you want to console.log before an error occurs yoou should console.log. . . before this error may happen.
    I put a line in your code :

    for(var i in result)
    {
    console.log(`result: ${result}, result[i]: ${result[i]}, typeof result[i]:${typeof result[i]}`)  // <-- here is my line !
      result[i].reverse();
      result[i] = result[i].join(' ');
    }
    

    . . . and got this log :

     Add (chaining) 2 players
    Log
    result: Ada: 44,,,Bob,88,Clo,10, result[i]: Ada: 44, typeof result[i]: string
    
    

    When you try to use .reverse (an array method) on Ada: 44 (a string) an error happens !

    Don't give up poor po !

    ; ) )

    PS: nice new nick name !

  • Default User Avatar

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

  • Default User Avatar

    how do i delete a comment?

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    In random cases :

    • a new HallOfFame is created with size and players arguments. eg xxx = new HallOfFame(3,[["ZZ",12],["xxx",9],["YyY",13]])
      Then size of its length is tested (should be equal to 'size' )
    • then a list of players is added on after another, and each time a new player is added, the list of the tested Hall is compared to expected list
      (ie list of same size but with only avaible players, sorted as required)

    Does it help ?

    ; ) )

  • Default User Avatar

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

  • Default User Avatar

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

  • Loading more items...