For a word w and a partial word u of the same length, say w derives u if w can be transformed into u by inserting holes, i.e., by replacing letters with don’t cares, with the restriction that no two holes may be within distance two. We present and prove a necessary and sufficient condition for a word of even length (at least eight) to not derive any squares (such word is called non-squareable). The condition can be decided in O(n) time, where n is the length of the word.
KeywordsCombinatorics on words Partial words Squareable word Squares
Unable to display preview. Download preview PDF.
- 5.Fischer, M., Paterson, M.: String matching and other products. In: Karp, R. (ed.) 7th SIAM-AMS Complexity of Computation, pp. 113–125 (1974)Google Scholar