Solution missing output "( ( ) ) ( )" for n = 3?


  • 0
    L

    I'm getting the same output as the example:

    [ "( ( ( ) ) ) )", "( ( ) ( ) )", "( ( ) ) ( )", "( ) ( ( ) )" "( ) ( ) ( )"]

    But the judge says wrong answer and the expected output is missing "( ( ) ) ( )".

    Anyone hitting the same issue?


  • 0
    W

    I am having similar issue. But I think the judge is expecting a specific order, This is the error message I got. I think I am outputting in different orders, and the judge does not like it.

    Input:	4
    Output:	["(((())))","((()))()","()((()))","((())())","(())()()","()(())()","(()(()))","()(())()","()()(())","((()()))","(()())()","()(()())","(()()())","()()()()"]
    Expected:	["(((())))","((()()))","((())())","((()))()","(()(()))","(()()())","(()())()","(())(())","(())()()","()((()))","()(()())","()(())()","()()(())","()()()()"]

  • 0
    S

    Check your output carefully, there are 2 "()(())()” in your result, so it get WA.


  • 0
    S

    Could you please sharing your algorithm and code with some comments in it? I believe the judge is ok, maybe there are some bug in your code.


Log in to reply
 

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