Did I solve the wrong problem?

  softwareengineering

not a technical problem to be solved, more of a sanity check, I recently completed a coding challenge that asked me to do the following:

In text processing, one approach to making a document appealing to the eye is to justify text. With monospaced fonts in a terminal, as you might see in a man page, this is accomplished by inserting spaces between words to produce a line of text where the first character of that line begins on the left-hand margin and the last printable character is on the righthand margin.

For this problem, we would like you to think of a single line of text and return a justified string.

Here is my solution:

https://gist.github.com/ldco2016/66b9068972fd07a2ea4bc1e0e9d88c7d

I threw the above solution into a React component and rendered it, fyi
But again, simple question, did I solve the wrong problem?

LEAVE A COMMENT