Apply Substitutions with Nested Replacements and Cycle Detection

Given a replacement dictionary replacements (each entry is key=value) and a string text. Each placeholder %key% in the text must be replaced by the corresponding value.

The interview had thre...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: