Upper case conversion
School Accuracy: 40.37% Submissions: 166 Points: 0

Given a string str, convert the first letter of each word in the string to uppercase. 

Example 1:

str = "i love programming"
Output: "I Love Programming"
'I', 'L', 'P' are the first letters of 
the three words.

Your Task:  
You dont need to read input or print anything. Complete the function transform() which takes s as input parameter and returns the transformed string.

Expected Time Complexity: O(N)
Expected Auxiliary Space: O(N) to store resultant string  

1 <= N <= 104
The original string str only consists of lowercase alphabets and spaces to separate words.


to report an issue on this page.


We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?


All Submissions

My Submissions:

Login to access your submissions.

Upper case conversion

Output Window