Wierd~ WrongAnswer when input is "a" and output is "a"


  • 0
    L

    I used Manacher solution and got this

    Submission Result: Wrong Answer

    Input:
    "a"

    Output:
    "a"

    Expected:
    "a"

    Can anybody tell me what happened??thx


  • 0

    I am facing the same problem. My first solution passed. But when I tried to submit my second solution, it fails in this test case.

    So I tested my code. Looks like even though my code returns string "a", its length is somehow 2. Which means returned string must be something of the form "a\some-whitespace-or-null-character"or "\some-whitespace-or-null-character-then-a".


  • 0
    L

    yes, you are right.
    In fact my program returned "\0a", which cause by wrong start iterator.
    Problem sovled .Thank you !


Log in to reply
 

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