-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edge case for Delivery Time estimation #10
Comments
Edge case 1: Base Delivery Cost + (Package Total Weight * 10) +
The result should be
Exact unit test for this case:
Added few several test cases as well like send 4 or 5 package together in the same file above 👆 |
Given 7 packages like this:
Then the sequence should be
Then Trip 1,
Trip 2
Trip 3
So end up the result look like this, only delivery time stated :
|
Added the test case above 👆 in this commit 1e54b69 In this PR #11 |
Solved in PR #11, close for now. If still have issues, comment below |
Quickly drop down some of my high level thinking above the solution: For instance I have an original input like this:
Then I need to get all the possible combination of the input above, store in an array named
Each of the array inside Then
Then optimize for (aka send first)
After determine which is the combo
|
TLDR:
Change this in
getPackageDeliveryCombo
methodBeside to meet the requirement, all the possible edge case also need to be handle
Example:
In this case, P1, P2, P5 should deliver first .
If have more than 1 combination which is highest possible weight, then we have to decide using Distance.
The text was updated successfully, but these errors were encountered: