Ad
  • Custom User Avatar

    The no. of miles that the car runs before running out of fuel doesn't need to be exactly equaly to the distance to pump, so also include the cases in which the car has more fuel or gives higher milage.

  • Custom User Avatar

    There is nothing wrong, you're misunderstanding when to return an empty string, and it's only in this case:

    If any of the input lists is empty, return an empty string

    You're either not doing it, or doing it when all the counts in the result are 0.

  • Custom User Avatar

    You could, however, make an argument that the description is confusing. "rounded to the smallest value" here simply means "rounded down".

  • Custom User Avatar

    rounded to the smallest value.

    Please read again the description and fix your code.

  • Custom User Avatar
  • Custom User Avatar

    What will your solution return when you are 1 mile away from a pump, you have 2 gallons of fuel left, and your car can travel 100 miles on one gallon?