Skip to content

Latest commit

 

History

History
executable file
·
23 lines (11 loc) · 592 Bytes

Caesar_Cipher_Encryptor.md

File metadata and controls

executable file
·
23 lines (11 loc) · 592 Bytes

Caesar Cipher Encryptor

Problem Statement

Given a non-empty string of lowercase letters and a non-negative integer value representing a key, write a function that returns a new string obtained by shifting every letter in the input string by k positions in the alphabet, where k is the key. Note that letters should "wrap" around the alphabet; in other words, the letter "z" shifted by 1 returns the letter "a".

Sample input:"xyz", 2 Sample output:"zab"

Explanation

We can use a Stack here

Solution

Check this Python code.