-
5 Comments
In above case it returns 567.90, correct answer would be 167.94. This solution is minimizing last digit which works in most cases, but is based on wrong assumptions. It passes test, but doesn't solve the problem. Yes, my later submissions doesn't have this bug, but I'm unsatisfied when those wrong ones are going through the test alive :-)
You had me confused, since that specific combination isn't in the test suite, but I think I understand now. In your quest for perfection, you've been testing the solution against more test cases. That's the really difficult thing about making these problems—coming up with a robust test suite that's in-depth enough to only let completely correct solutions through.
Sorry Grant. Yes, I'm used to do more tests and I was suspicious about my algorithm.
Suggested Problems
-
Remove all the words that end with "ain"
2431 Solvers
-
2287 Solvers
-
431 Solvers
-
422 Solvers
-
15620 Solvers
More from this Author139
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!