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:
- Convert all lowercase characters to uppercase whose ASCII value is co-prime with k
- Maximum distinct lowercase alphabets between two uppercase
- Program to display all alphabets from A to Z in uppercase and lowercase both
- Count Uppercase, Lowercase, special character and numeric values
- Minimum number of operations to move all uppercase characters before all lower case characters
- Check whether two strings contain same characters in same order
- Check if the characters of a given string are in alphabetical order
- 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 if string follows order of characters defined by a pattern or not | Set 1
- Print characters having even frequencies in order of occurrence
- Print characters in decreasing order of frequency
- Print characters and their frequencies in order of occurrence
- Print characters having odd frequencies in order of occurrence
- Print all distinct characters of a string in order (3 Methods)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.