![]() |
VOOZH | about |
You are given an array of characters which is basically a sentence. However, there is no space between different words and the first letter of every word is in uppercase. You need to print this sentence after following amendments:
Examples:
Input : BruceWayneIsBatman
Output : bruce wayne is batman
Input : You
Output : you
We check if the current character is in uppercase then print " "(space) and convert it into lowercase.
Implementation:
bruce wayne is batman
Time complexity:O(n)
Auxiliary Space: O(1)
bruce wayne is batman
Time complexity: O(n)
Auxiliary Space: O(n)