Most of the solutions from stack-based languages that I have seen always include a good amount of fiddling with the stack to get the stuff in the right order
BTW, @KennyLau I saw this answer on the same question and I thought it was you and said to myself, "where the heck did all of his rep go??" After that I checked his profile and realized it wasn't you
@KennyLau my solution is so small because I interpreted the rules as many of the other answers did. We have yet to have a reply from the OP to what goes and what doesn't.
Convex, 4 bytes
\Ter
Try it online!
Takes input via command line args, with the first being the substitution map, and second being the string to change (which includes newlines).
This can be shortened to 3 bytes if the substitution map can come second:
Ter
Try it online!
Explanation:
...
Pyth, 4 bytes
XEGQ
Try it online!
How it works:
XEGQ
Q = input()
XEGQ input().translate("abcdefghijklmnopqrstuvwxyz",Q)
X .translate( , )
E input()
G "abcdefghijklmnopqrstuvwxyz"
Q ...
I'm pretty comfortable in Rust at this point, moreso than C/C++, and I don't want to use Ruby because runtime is rather important. If it's clear that the bottleneck is the algorithm and not the speed of the language, though, I may switch over to Ruby on some of the problems