Problem : Given an input string , separate the input string into a space-separated sequence of dictionary words if possible. For example, if the input string is "helloworld" then we would return the string "hello world" as output.
Assume you are given a Dictionary against which you can check the validity of words. Print "String can not be separated" if it contains numbers , any special character or any invalid combination of character/word.
Solution in java
Please note this code was tested against multiple use cases and return correct results, let us know if any of the use case if fails to pass.
Run time result