aayushi-droid / Edabit-Solutions

Edabit Solutions using Cpp(C++)
MIT License
39 stars 155 forks source link

Caesar's Cipher - Edabit #80

Closed Sanskar31 closed 3 years ago

Sanskar31 commented 3 years ago

Before jumping into Pr first comment for assign.

Problem statement :
Julius Caesar protected his confidential information by encrypting it using a cipher. Caesar's cipher (check Resources tab for more info) shifts each letter by a number of letters. If the shift takes you past the end of the alphabet, just rotate back to the front of the alphabet. In the case of a rotation by 3, w, x, y and z would map to z, a, b and c.

Create a function that takes a string s (text to be encrypted) and an integer k (the rotation factor). It should return an encrypted string.

Sample Tests:

caesarCipher("middle-Outz", 2) ➞ "okffng-Qwvb"

// m -> o // i -> k // d -> f // d -> f // l -> n // e -> g // - - // O -> Q // u -> w // t -> v // z -> b

caesarCipher("Always-Look-on-the-Bright-Side-of-Life", 5) ➞ "Fqbfdx-Qttp-ts-ymj-Gwnlmy-Xnij-tk-Qnkj"

caesarCipher("A friend in need is a friend indeed", 20) ➞ "U zlcyhx ch hyyx cm u zlcyhx chxyyx"

Probelm Link : https://edabit.com/challenge/GmPfqu2jmLDBD2NYS Choose one Cateorgy - Very Easy, Easy, Medium, Hard, Very Hard, Expert question category : Very Hard


Before submitting a PR please Check some details.

This repository is vaild for HacktoberFest2020

Read before making PR - How to contribute on Github Good Luck,

Sanskar31 commented 3 years ago

@aayushi-droid please assign this issue to me. I will try my best to solve it.

Regards Sanskar

ashishrrs commented 3 years ago

i would love to work on this problem

sidanand67 commented 3 years ago

Hello, I can solve this problem keeping in view all the set rules for submission.