Skip to content

Files

Latest commit

2e108b8 · Jul 20, 2023

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jul 20, 2023
Feb 7, 2023
Feb 7, 2023

Caesar Cipher

Instructions

Given a string and integer shift implement a function which shifts each character in that string by shift amount (cesar cipher) eg. if shift is 1 then a becomes b, c becomesd, z became a etc. Allowed input is string containing only lowercase characters from alphabet abcdefghijklmnopqrstuvwxyz.

Challenge | Solution

Examples

encodeCaesarCipher("abc", 1) // bcd

encodeCaesarCipher("abc", 3) // def

encodeCaesarCipher("xyz", 1) // yza

Hints

Hint 1 Use ASCI character table