I think the solution is not unique.
can u tell me where/which test suite u're facing problem?
cz I think the solution should be unique since there is only one parameter.
In the test2. Why [7 3 4 5 6] is not right?
ok..i see..
if there are more than one possibilities..they should be placed in sorted manner. that should do it
sorted?[3 4] or [4 3] in test2?
sorted based on the marks --
[40,50] == [4,3]
found it difficult but fun :)
The problem is not difficult, but the test suite should accept all possible solutions since there is not an unique order, for instance at test cases #2 and #4. Sorting values increases this problem's difficulty since there may be several works with the same (or complementary) weight that can be done to achieve the same score (a proper description should be added to the problem since there may cases which are not trivial to sort).
PS: In this problem when any two works have the same deadline, but their marks differ, the lowest mark should come first (which seems weird). And no explanation is given for two works that have the same deadline and mark (but at least there isn't a case at the test suite).
1409 Solvers
Back to basics 3 - Temp Directory
330 Solvers
Sort numbers by outside digits
129 Solvers
Remove from a 2-D matrix all the rows that contain at least one element less than or equal to 4
141 Solvers
Piecewise linear interpolation
302 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!