Given a string s and an integer shift, apply a Caesar cipher by shifting every letter in the string by shift positions in the alphabet.
Rules:
'z' by 1 gives 'a', shifting 'a' by -1 gives 'z'shift can be any integer (positive, negative, or zero)s = "abc", shift = 3"def"s = "Hello, World!", shift = 13"Uryyb, Jbeyq!"s = "xyz", shift = 3"abc"0 <= s.length <= 10^4-10^6 <= shift <= 10^6s contains printable ASCII charactersRun your code to see results
Use Cmd+Enter to run