A suffix array sorts all suffixes of a string lexicographically. Built in O(n log n) with prefix doubling and paired with the Kasai LCP array, it answers substring search, distinct substring count, and longest repeated substring queries in optimal time.
Counting distinct substrings of a string is the gateway problem to suffix arrays and suffix automata. Three classical solutions — n^2 hash set, suffix array plus LCP, and suffix automaton — span the full toolbox of competitive programming and FAANG hard interviews.
Optimize your Next.js 15 application for Core Web Vitals with actionable techniques covering image optimization, font loading, code splitting, caching, streaming, and bundle analysis. For developers who want measurably faster Next.js applications.
Practical guide to improving Core Web Vitals in 2026 — targeting LCP under 2.5s, CLS under 0.1, and INP under 200ms with real measurement strategies and code optimizations.