Text packing algorithm
问题 I bet somebody has solved this before, but my searches have come up empty. I want to pack a list of words into a buffer, keeping track of the starting position and length of each word. The trick is that I'd like to pack the buffer efficiently by eliminating the redundancy. Example: doll dollhouse house These can be packed into the buffer simply as dollhouse , remembering that doll is four letters starting at position 0, dollhouse is nine letters at 0, and house is five letters at 3. What I've