Use the leetcode assessment of test correctness #149
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The code currently decides whether or not the answer is the expected answer by comparing the
code_answer
andexpected_code_answer
output blocks in the response to see if they're the same. This can be an issue for problems where the output is a list but the problem specifies that the order doesn't matter. For instance, for problem 49 (Group Anagrams) the problem states that "You can return the answer in any order." However, running my solution to that problem gave:in the
*leetcode-result-49*
buffer. The problem here is that the we're not respecting the order-insensitivity of the answer the problem specifies.Looking at the result data structure, we see that there is also a
correct_answer
field which is the Leetcode assessment of whether the answer was correct or not. For example, in the case shown above the "correct_answer" field is set to "true".This change uses the "correct_answer" field to decide whether the test passed or failed, rather than comparing the output blocks directly.
Resolves #148