Can anyone say how to solve this problem 100% correct??
My solution isn't correct, it doesn't work on test cases like:
ABCIGGGGGGG
ABCHGGGGGGG
ABCABCABCAB
,but seems like there isn't a test case like this.
Gates solution is nice, but i don't understand that algorithm... :S
I studied a little suffix trees, but they are too confusing ... :S
My solution isn't correct, it doesn't work on test cases like:
ABCIGGGGGGG
ABCHGGGGGGG
ABCABCABCAB
,but seems like there isn't a test case like this.
Gates solution is nice, but i don't understand that algorithm... :S
I studied a little suffix trees, but they are too confusing ... :S