Ad
  • Custom User Avatar

    If more than one item you could produce would bring you equally close to the desiredRatio, return the lowest index amongst the equal options. (E.G. if producing item 5 or 7 would both bring you equally close, return 5).

    The tests expect the opposite.

  • Custom User Avatar

    Random tests are unacceptable: they're all of the form actualStock[i] = desiredRatio[i] + n for certain n.

  • Custom User Avatar

    You mention:

    if producing item 5 or 7 would both bring you equally close, return 5
    

    However my code returns the last item which satisfy the requirement and it passed the tests.
    The description is a bit difficult to follow, I bilieve some people give up since they don't get the idea of your kata.