Given a string str containing only lower and uppercase alphabets. The task is to check if both lowercase characters and uppercase characters follow the same order respectively.
Note: If a character occurs more than once in lowercase then the occurrence of the same character in the uppercase should be same.
Input: str = "geeGkEEsKS" Output: Yes Lowercase = geeks, Uppercase = GEEKS Input: str = "GeEkKg" Output: No Lowercase = ekg, Uppercase = GEK
- Traverse the string.
- Store the lowercase alphabets and uppercase alphabets in two separate strings lowerStr and upperStr respectively.
- Convert lowercase string to uppercase.
- Check if both uppercase strings are equal or not.
- Print Yes if equal, else print No.
Below is the implementation of above approach:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Check if a string contains uppercase, lowercase, special characters and numeric values
- Convert all lowercase characters to uppercase whose ASCII value is co-prime with k
- Count Uppercase, Lowercase, special character and numeric values
- Maximum distinct lowercase alphabets between two uppercase
- Check whether two strings contain same characters in same order
- Minimum number of operations to move all uppercase characters before all lower case characters
- String with k distinct characters and no same characters adjacent
- Min flips of continuous characters to make all characters same in a string
- Minimum characters that are to be inserted such that no three consecutive characters are same
- Minimum characters to be replaced to make frequency of all characters same
- First uppercase letter in a string (Iterative and Recursive)
- Sub-string that contains all lowercase alphabets after performing the given operation
- For each lowercase English alphabet find the count of strings having these alphabets
- Check if a string has all characters with same frequency with one variation allowed
- Check if frequency of all characters can become same by one removal
- Check if both halves of the string have same set of characters
- Quick way to check if all the characters of a string are same
- Check if both halves of the string have same set of characters in Python
- Check if a string can be split into two strings with same number of K-frequent characters
- Check if all strings of an array can be made same by interchanging characters
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 Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.