Hash and key
CodeChefOpen on judge ↗
You have given two strings consists of decimal numbers from 0 to 9 hash $H$ and key $K$ derive original string $S$ from it. The hash $H$ and key $K$ are generated from string $S$ as follow. n=len(s) j=1 k=1 i=0 while(i less than n-3) K[j]=str[i] K[j+1]=s[i+1] H[k]=key[j]^S[i+2] H[k+1]=K[j+1]^s[i+3] j=j+2 k=k+2 i=i+4 if
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.
Sign in to chat with the tutor and save your progress.
Sign in to start