Implement a word wrap algorithm in a function.
Anoniem
1. Gain clarity on what a word wrap algorithm means to the interviewer. 2. Develop a few test cases to ascertain what the interviewer expects and to serve as a guard for my implementation. 3. I commenced implementation iteratively and ran the tests to confirm my solution works.