Coding
Write code to implement a text wrapper that takes in a long string and a character limit as inputs and returns a list of strings, where each string is limited to the specified number of characters, split only at spaces. For example, if the input string is "This is a long sentence that needs to be wrapped", and the character limit is 10, the output should be a list with three strings: ["This is a", "long", "sentence that", "needs to be", "wrapped"].
Data Scientist
Uber
Apple
Snap
Lyft
Amazon Web Services
Interview question asked to Data Scientists interviewing at Hootsuite, Zillow, Whatsapp and others: Write code to implement a text wrapper that takes in a long string and a character limit as inputs and returns a list of strings, where each string is limited to the specified number of characters, split only at spaces. For example, if the input string is "This is a long sentence that needs to be wrapped", and the character limit is 10, the output should be a list with three strings: ["This is a", "long", "sentence that", "needs to be", "wrapped"]..