题目描述
Given a string which is basically a sentence without spaces between words. However the first letter of every word is in uppercase. You need to print this sentence after following amendments:
(i) Put a single space between these words
(ii) Convert the uppercase letters to lowercase.
Note: The first character of the string can be both uppercase/lowercase.
Example 1:
Input:
s = "BruceWayneIsBatman"
Output: bruce wayne is batman
Explanation: The words in the string are
"Bruce", "Wayne", "Is", "Batman".
ââ¬â¹Example 2:
Input:
s = "You"
Output: you
Explanation: The only word in the string
is "You".
Your Task:
You don't need to read input or print anything. Your task is to complete the function amendSentence() which takes the string s as input and returns a string with the stated amendments.
Expected Time Complexity: O(N).
Expected Auxiliary Space: O(N) (for output string).
Constraints:
1<=Size of String <=10^{6}
输入格式
见题面
输出格式
见题面