If the corrupted file looks like “CodingNinjasIsACodingPlatform”, then the original file was: “coding ninjas is a coding platform”.
You need to convert all the uppercase characters to lowercase characters, and you need to add a single space between every two words.
The first line contains a single integer ‘T’ representing the number of test cases.
The first line of each test case will contain a string ‘S’, which denotes the corrupted string that you need to to change.
For each test case, print a single line containing a string denoting the original sentence.
The output for every test case will be printed in a separate line.
You don't need to print anything, It has already been taken care of. Just implement the given function.
1 <= T <= 50
0 <= size of S <= 10000
where ‘T’ is the number of test cases.
where 'S’ is the corrupted string that you need to to change.
Time limit: 1 sec
The basic approach is to traverse through the complete string of characters and check if the character is in uppercase or lowercase. If it is in uppercase, simply update the character with a space followed by the lowercase conversion of the character.
Algorithm:
Divisible Substrings
Ninja and Numbers
Longest Palindromic Substring
Cakes
1-3 Palindrome