takeUforward
Longest String with All Prefixes - Tutorial