By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
Complete the code challenge below. Read the instructions carefully and use the integrated editor on the right to write and run your solution.
Compute how much a stable prefix saves. Notice what happens when a dynamic value sits at the START of the prompt: the shared prefix is zero, so you save nothing.
Try it on paper: 'You are a bot. Q: A' has 6 words; five are shared with '...Q: B'.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.