I've used the Z-Algorithm but got WA of 4 test cases.
Hidden_Line you must get string as a line ::)
user203242 thank you.But very dumb tho.
user203242 Thanks, what difference does it make ?
user974152 cin stops reading once it encounters space
user203242 like getline (cin, string) ?