← All problemsSign in

Minimum Hash

Let's define the Hash of a single character as (its ASCII code minus 96). And similarly the Hash of a string $S$ of size $N$ is defined here as $hash(S.substring(0,N-2))*30 + hash(S[N-1])$ where $S.substring(i,j)$ is the substring of $S$ starting at $i^{th}$ index and ending at $j^{th}$ index. Tejas has some text $S$ $(|S| < 1000000)$ and a target string $Tar$. He was given the task to find the

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start