✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
Case 2a of the Z-algorithm handles the scenario where l\le k\le r and
Z[k-l+1] < r-k+1. This case requires explicit character comparisons to determine
Z[k] value