Wrong answer for "ABCD",2


  • 0
    L

    Python
    Input: "ABCD", 2
    Output: "ACDB"
    Expected: "ACBD"

    A C D
    B
    

    even you consider this:

    A   D
    B C
    

    The answer is never ACBD I think


  • 7
    S

    For ABCD, 2, the zig-zag format should be like (lines are just for easily understanding):

    A   C
    | / |
    B   D
    

    So the answer is ACBD


Log in to reply
 

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