Skip to main content

Intro about Password Validator Caesar Cipher and Emirp mumbers

Password Validator
Password validator is a program that validates passwords to match specific rules. For example, the minimum length of the password must be eight characters long and it should have at least one uppercase letter in it.
A valid password is the one that conforms to the following rules:
- Minimum length is 5;
- Maximum length is 10;
- Should contain at least one number;
- Should contain at least one special character (such as &, +, @, $, #, %, etc.);
- Should not contain spaces.
Examples:
Input: "Sololearn"
Output: false
Input: "John Doe"
Output: false
Input: "$ololearn7"
Output: true
Write a program to checks if the user input is a valid password or not.


Caesar Cipher
The Caesar cipher is a type of substitution cipher in which each letter in the plaintext is shifted to a certain number of places down the alphabet. For example, with a shift of 1, A would be replaced by B, B would become C, and so on. The method is named after Julius Caesar, who allegedly used it to communicate with his generals.
For example:
Input: "defend the east wall of the castle"
Output: "efgfoe uif fbtu xbmm pg uif dbtumf"
Write a program that encrypts the user input using the Caesar cipher.


Emirp mumbers
An emirp is a prime number that results in a different prime when its decimal digits are reversed. For example, 13 is an emirp number because both 13 and 31 are prime numbers.
For example:
Input: 17
Output: true (17 and 71 are prime numbers)
Input: 113
Output: true (113 and 311 are prime numbers)
Input: 23
Output: false (23 is a prime number, but 32 is not)
Write a program to check if the user input is an emirp number or not.




Find The First Recurring Character
Write a program that takes a string asinput and returns the first recurring character as the output.

For example:
Input: "ABCA"
Output: A

Input: "BCABA"
Output: B

Input: "ABC"
Output: None

Comments

Popular posts from this blog

The Entrepreneurial Journey of Ashish Mishra: A Visionary Leader in Business and Technology

In the dynamic world of business and technology, Ashish Mishra stands out as a true trailblazer, successfully navigating the realms of entrepreneurship with two thriving ventures under his belt. With an impressive background as a salesperson and a keen eye for business opportunities, Ashish has carved a niche for himself as the founder and driving force behind Pentagon Decorators and Tech HB82. Early Career: A Foundation in Sales Ashish's journey into the business world began as a salesperson, where he honed his communication skills and developed a deep understanding of customer needs. Spending nearly three years in the challenging yet rewarding field of sales laid the groundwork for his future ventures. It was during this time that he cultivated the entrepreneurial spirit that would eventually lead him to launch his own businesses. Tech HB82: Bridging the Gap in Technology In 2019, Ashish took a bold step into the tech industry with the inception of Tech HB82. Recognizing the eve...

Ashish Mishra - Founder of Tech HB82

Ashish Mishra and Abhidhruv Bhatiya founded Tech HB82 Corporate in 2020 The duo has exposure to IT and SaaS companies and systems in the West as well as Southeast n passenger Asia, thereby bringing a wealth of knowledge and experience to the table. Through Tech HB82 , the founders are looking to build the country's first Research & Development Organization (R&D O)- a holistic concept where companies don't just simply cover R&D Expenses, but also, actively manage customers' IT conditions thereby leading to better long-term tech & innovation outcomes.