Should (3,[[0,1],[0,2],[1,2]]) return false?


  • 0
    G

    The parameters in title should return true, b/c there's no circle formed in this case.

    But if I'm right, the test cases missed such a case or similar. b/c my code returning that case 'false' passed all the test cases in OJ.

    The test case in C++ BTW:

    vector<vector<int>> vvi = { { 0, 1 }, { 0,  2}, { 1,2 } };
    bool bb = canFinish(3, vvi);
    

    Please clarify if bb should be false or true.

    Thanks.


  • 0

    You are right, it should return true. I have added your test case and your solution gets Wrong Answer now. Thanks!


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.