Available question text
Find the earliest length-k substring of s whose polynomial rolling hash (sum of val(ch)*power^i mod modulo) equals hashValue. This requires using modular arithmetic and an efficient rolling-hash/sliding-window approach to check all length-k substrings in O(n) time.
Related questions
Continue with questions that share topics or the same question type.
- Count Paths With the Given XOR Value
Coding
- Delete Leaves With a Given Value
Coding
- Find a Value of a Mysterious Function Closest to Target
Coding
- Find All Possible Recipes from Given Supplies
Coding · Array · Directed Acyclic Graph · Graph Theory
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2156. Find Substring With Given Hash Value
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source