variables, each entry a pair [name, value]. A name is a single uppercase English letter. A value is a string that may contain references to other variables written as %X%, where X is a variable name.
You also get a template: one or more references to distinct variables, joined by _.
Replace every reference %X% with the value of X, and keep going until no references remain (values get expanded too). Return the resulting string.
The variables have no circular dependencies, and every reference points to an existing variable.variables=[['N', 'anna'], ['C', 'paris']], template='%N%_%C%' → 'anna_paris'
%N% becomes "anna" and %C% becomes "paris".
variables=[['G', 'hi_%U%'], ['U', 'bob'], ['D', '%G%%U%']], template='%D%_%U%_%G%' → 'hi_bobbob_bob_hi_bob'
%G% expands to "hi_bob", so %D% is "hi_bob" + "bob" = "hi_bobbob".
variables=[['Z', '42']], template='%Z%' → '42'
_ and %X% referencestemplate consists of %X% references to distinct variables joined by _variables=[['N', 'anna'], ['C', 'paris']], template='%N%_%C%'
'anna_paris'
Run checks the first 3 tests in your browser. Submit checks all 37 tests on the server, hidden ones included.