Given a permutation of the alphabet and an input string, encrypt the input string by replacing all characters with the one's you've been given. The capitalization should be kept the same and non-letters are not to be changed.
[hnvwyajzpuetroifqkxmblgcsd], "Hello, World!" -> "Zytti, Giktw!"
As [abcdefghijklmnopqrstuvwxyz]
has been mapped to [hnvwyajzpuetroifqkxmblgcsd]
IO
Input may be taken in any reasonable form, output can either be to STDOUT
or as a String.
More test cases:
[ghrbufspqklwezvitmnjcdyaox], "Foo" -> "Fvv"
[ubjvhketxrfigzpwcalmoqysdn], "123Test String :D" -> "123Mhlm Lmaxze :V"
[qscxudkgemwrtbvnzolhyfaipj], "AAbcdeFghijK" -> "QQscxuDkgemW"
Standard ruleset applies!