O(n) Rotational Cipher in Python

Data Center Proxies - Data Collectors - Data Unblockers

Rotational Cipher: One simple way to encrypt a string is to “rotate” every alphanumeric character by a certain amount. Rotating a character means replacing it with another character that is a certain number of steps away in normal alphabetic or numerical order. For example, if the string “Zebra-493?” is rotated 3 places, the resulting string is “Cheud-726?”. Every alphabetic character is replaced with the character 3 letters higher (wrapping around from Z to A), and every numeric character replaced with the character 3 digits higher (wrapping around from 9 to 0). Note that the non-alphanumeric characters remain unchanged. Given a string and a rotation factor, return an encrypted string.

Signature

string rotationalCipher(string input, int rotationFactor)

Input

1 <= |input| <= 1,000,000 0 <= rotationFactor <= 1,000,000

Data Center Proxies - Data Collectors - Data Unblockers

Output

Return the result of rotating input a number of times equal to rotationFactor.

Example 1

input = Zebra-493?

rotationFactor = 3

output = Cheud-726?

Example 2

input = abcdefghijklmNOPQRSTUVWXYZ0123456789

rotationFactor = 39

output = nopqrstuvwxyzABCDEFGHIJKLM9012345678

O(n) Solution in Python:

Test 1:

PS C:\dev\scripts> .\test_rotational_cipher_python.py
Length Dic Numbers : 10
Length Dic lowercase : 26
Length Dic uppercase : 26
Input: Zebra-493?
Output: Cheud-726?

Test2:

PS C:\dev\scripts> .\test_rotational_cipher_python.py
Length Dic Numbers : 10
Length Dic lowercase : 26
Length Dic uppercase : 26
Input: abcdefghijklmNOPQRSTUVWXYZ0123456789
Output: nopqrstuvwxyzABCDEFGHIJKLM9012345678




The Cloud is the future: The AWS Certified Solutions Architect – Associate Average salary is $149,446/year. Get Certified Now with the apps below:

‎Cloud Cert Prep: AWS Azure GCP
‎Cloud Cert Prep: AWS Azure GCP
  • ‎Cloud Cert Prep: AWS Azure GCP Screenshot
  • ‎Cloud Cert Prep: AWS Azure GCP Screenshot
  • ‎Cloud Cert Prep: AWS Azure GCP Screenshot
  • ‎Cloud Cert Prep: AWS Azure GCP Screenshot
  • ‎Cloud Cert Prep: AWS Azure GCP Screenshot
  • ‎Cloud Cert Prep: AWS Azure GCP Screenshot
  • ‎Cloud Cert Prep: AWS Azure GCP Screenshot





Solution Architect PRO
Solution Architect PRO
Developer:
‪Etienne Noumen‬
Price:
$5.39


AWS Certified Cloud Practitioner Exam Prep CCP PRO
AWS Certified Cloud Practitioner Exam Prep CCP PRO
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot
  • AWS Certified Cloud Practitioner Exam Prep CCP PRO Screenshot


AWS Certified Cloud Practitioner Mock Exams Pro
AWS Certified Cloud Practitioner Mock Exams Pro
Developer:
‪Etienne Noumen‬
Price:
$5.39



AWS Certified Developer Associate Practice Exams
AWS Certified Developer Associate Practice Exams
Developer:
Etienne D. Noumen
Price:
$4.49

  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot
  • AWS Certified Developer Associate Practice Exams Screenshot


‎AWS Certified Developer A. PRO
‎AWS Certified Developer A. PRO
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot
  • ‎AWS Certified Developer A. PRO Screenshot


AWS Certified Developer Associate Exam Prep
AWS Certified Developer Associate Exam Prep
Developer:
‪Etienne Noumen‬
Price:
Free


Djamga PRO: Pick Up Games Nearby, Fitness, Workout
Djamga PRO: Pick Up Games Nearby, Fitness, Workout
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot
  • Djamga PRO: Pick Up Games Nearby, Fitness, Workout Screenshot

Djamga PRO: Pick Up Games, Health and Fitness Calculator
Djamga PRO: Pick Up Games, Health and Fitness Calculator
Developer:
‪Etienne Noumen‬
Price:
$3.49


taimienphi.vn