CamelCase
Problem Description
Alice wrote a sequence of words in CamelCase as a string of letters, S, having the following properties:
1. It is a concatenation of one or more words consisting of English letters.
2. All letters in the first word are lowercase.
3. For each of the subsequent words, the first letter is uppercase and rest of the letters is lowercase.
Given S, print the number of words in S on a new line.
Input:
A single line containing string S.
Output:
Print the number of words in string S.
CODING ARENA
a=input()
count=1
x=len(a)
for i in range(x):
if(a[i].isupper()):
count+=1
print(count)
Test Case 1
Input (stdin)thisIsIndiaWelcome
Expected Output
4
Test Case 2
Input (stdin)hiThisIsTamilnaduInIndia
Expected Output
6
No comments:
Post a Comment