← All problemsSign in

Danny and the Square Difference

Danny gets a long string of length $N$ comprising only of numerals. He is very fond of mathematics and tries experimenting on it but cannot think of anything. His brother Manny helps him out by giving him a question. He asks Danny to identify all the contiguous segments of size $K$ from the sub string beginning at $A$ and ending at $B$ both inclusive that can be represented in the form of $a^2 - b

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