Problem 745 · Hard
Precompute every suffix#prefix key per word so each query is a single hash lookup returning the largest index.
Open the interactive visualisation