CamelCase is the sequence of one or more than one words having the following properties:
- It is a concatenation of one or more words consisting of English letters.
- All letters in the first word are lowercase.
- For each of the subsequent words, the first letter is uppercase and rest of the letters are lowercase.
Given a CamelCase sequence represented as a string. The task is to find the number of words in the CamelCase sequence.
Input : str = "geeksForGeeks" Output : 3 Input : str = "iGotAnInternInGeeksForGeeks" Output : 8
Approach: As it is already known that the sequence is CamelCase, so it can be said that the number of words in the sequence will be one more than the number of uppercase letters.
- Iterate the sequence from the 2nd letter to the end of the sequence.
- No. of words will be equal to uppercase letters+1 during the 1st step iteration.
Below is the implementation of the above approach:
- Print all words matching a pattern in CamelCase Notation Dictonary
- Given a sequence of words, print all anagrams together using STL
- Given a sequence of words, print all anagrams together | Set 2
- Given a sequence of words, print all anagrams together | Set 1
- Check if the given string of words can be formed from words present in the dictionary
- Reverse String according to the number of words
- Count words that appear exactly two times in an array of words
- Print number of words, vowels and frequency of each character
- Count the number of words having sum of ASCII values less than and greater than k
- Form minimum number from given sequence
- Find if the given number is present in the infinite sequence or not
- Total number of odd length palindrome sub-sequence around each centre
- Find a sequence of N prime numbers whose sum is a composite number
- Convert an unbalanced bracket sequence to a balanced sequence
- Minimum number of operations to convert a given sequence into a Geometric Progression
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.