Amazon | Phone Interview | Add Missing Spaces
818
Aug 20, 2024
Aug 20, 2024
A recent deployment to your team's service to remove extra whitespaces from user provided strings before saving them to a database ended up removing all the spaces between words before saving to database.
We need to write a function to help recover this data. The function will receive a string as input representing a one sentence. The function should find the word boundaries that exist within the input string, and insert a single space between each word before returning the corrected string as an output.
Input: 'helpmeandaddspaces'
Output: ''help me and add'
Assumption: There will be a dictonary method that will return a word is valid or invalid. eg: 'He' is a valid word
Location: Seattle
Role: SDE 2
Comments (3)


