Skip to content

Bug Report: Incorrect Acceptance of Invalid Solution (find-the-town-judge) #5506

@Ali-Al-Hadi-Al-Husseini

Description

Bug Report for https://neetcode.io/problems/find-the-town-judge
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.

The platform incorrectly marks the following solution as Accepted, even though it does not correctly handle multiple valid edge cases and should fail for certain inputs.

class Solution:
    def findJudge(self, n: int, trust: List[List[int]]) -> int:
        trusted = trust[0][1]
        
        for trss in trust:
            if trss[1] != trusted:
                return -1
        
        return trusted
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions