A password is said to be strong if it satisfies the following criteria:
- It contains at least one lowercase English character.
- It contains at least one uppercase English character.
- It contains at least one special character. The special characters are: !@#$%^&*()-+
- Its length is at least 8.
- It contains at least one digit.
Given a string, find its strength. Let a strong password is one that satisfies all above conditions. A moderate password is one that satisfies first three conditions and has length at least 6. Otherwise password is week.
Input : "GeeksforGeeks!@12" Output : Strong Input : "gfg!@12" Output : Moderate
This article is contributed by Apurva Agarwal. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- A Program to check if strings are rotations of each other or not
- Write a program to print all permutations of a given string
- Write a program to reverse an array or string
- Check for balanced parentheses in an expression
- Check whether two strings are anagram of each other
- Program to validate an IP address
- Check if a given string is a rotation of a palindrome
- Check a given sentence for a given set of simple grammer rules
- Check if a given sequence of moves for a robot is circular or not
- Check if two given strings are isomorphic to each other
- Check if edit distance between two strings is one
- Check if string follows order of characters defined by a pattern or not | Set 1
- Check if string follows order of characters defined by a pattern or not | Set 2
- Check if string follows order of characters defined by a pattern or not | Set 3
- Check whether a given number is even or odd