What's wrong with input "AAAAAAAAAAAA"?

  • 0

    Here is my code


    and I always get wrong answer when

    Input: 		"AAAAAAAAAAAA"
    Output: 	["AAAAAAAAAAA"]
    Expected: 	["AAAAAAAAAA"]

    It shows that my output contains 11 A's but the same code just gets 10 in my local test with Visual Studio Express 2013 (Windows 8.1) and g++ 4.8.2 (Ubuntu 14.04 on virtual machine) and g++ 4.9.2 (ideone.com, please refer to the link above). I can get AC if I change line 44 from



    repeated_sequences.emplace_back(&s[i - 9]);

    Can anybody figure out what's the problem?

Log in to reply

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