NeetCode #161LC-3481MediumArrays & Hashing
← Back to All Problems

#161 · #3481 · Apply Substitutions(应用替换)

📌 Problem Statement & Constraints

You are given replacements, a list of [key, value] pairs where each key is a single uppercase letter and the value may contain placeholders of the form %X%. Given a text containing such placeholders, expand every placeholder recursively and return the resulting string. Constraints: 1 <= replacements.length <= 26; all keys are distinct; substitutions are guaranteed to terminate.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!