LeetCode-Feedback / LeetCode-Feedback

649 stars 304 forks source link

1013 judger is wrong #23

Closed kaiwensun closed 4 years ago

kaiwensun commented 4 years ago

What kind of the bug

Describe the bug With the input [1, -1, 1, -1], the standard OJ returns answer True. But the correct answer obviously should be False.

The code you submit/run

class Solution(object):
    def canThreePartsEqualSum(self, A):
        s = sum(A)
        if s % 3 != 0:
            return False
        s /= 3
        targets = [2 * s, s]
        acc = 0
        for a in A:
            if not targets:
                return True
            acc += a
            if acc == targets[-1]:
                targets.pop()
        return False

Expected behavior

Screenshots N/A

Additional context Looking for contribution rewards: https://leetcode.com/contribute/14546

lc-kate commented 4 years ago

Hi @kaiwensun, Thank you for raising this issue to our attention. We've fixed this issue and updated the problem with the new solutions and test cases.

kaiwensun commented 4 years ago

Hi @CooperCooperCooper I verified the issue was not fixed when I opened this issue. If you fixed the test case and the standard judge based on my test case contribution https://leetcode.com/contribute/14546, why is the contribution rejected?

lc-kate commented 4 years ago

Hi @kaiwensun, Thank you for reaching out to us. The expected output for test case [1, -1, 1, -1] has been updated to "False", which matches the output of your code, hence it's rejected.

The contribution is rejected because the test case was already included in this problem; the issue stemmed from the other parts of this problem. Our contribution platform is for contributing problems and test cases that have never been seen before. If you find issues of existing problems or test cases, please file them here in this Github repo.

If you're looking for more challenges, we suggest you take a look at our eligible list of bugs for our Bug Bounty program: https://leetcode.com/bugbounty/. We appreciate your support and understanding.