Algorithm · Amazon · Medium
You receive a string s that can include several marked tokens. A token begins with a semicolon ;, finishes with a colon :, and uses the text between those delimiters as its key—for instance, ;id: or ;color:. You also receive a map named dict that associates keys with replacement text (for example, { "id": "42" } replaces ;id: with 42). For each portion of s that forms a token and has a key present in dict, substitute the corresponding mapped string. A well-formed token whose…
Checking your access…