This is closely related to my previous post "Cannot pass the case [4, 3, 10], 10 (Combination Sum)" which is right below this post.
With some slight modifications on Combination Sum, I implemented Combination Sum II;
this time, again I have passed 171/172 of the test cases and was stuck with the last one [2,1,1,3,3], 4
The shown error message is as below:
Input: [2,1,1,3,3], 4
As can be seen, this error is very similar to the one that I had in "Cannot pass the case [4, 3, 10], 10 (Combination Sum)", which shows the followign error message:
Input: [4,3,10], 10
Both have the redundant target value in the output and both happen in the last test case.
Again in this case, on my local computer with compiler information (g++ follow the C++11 ISO C++ language standard [-std=c++11]), the result is correct and is [[1,1,2],[1,3]] instead of that indicated by leetCode, [[1,1,2],[1,3],]
Now I tend to think there is an error in the leetCode examination.
Does anyone have the same type of error as mine ?
Thanks for any response.