79159798

Date: 2024-11-05 15:52:15
Score: 2
Natty:
Report link

I needed to do something similar in order to find the most uniform way to split lines with the added wrinkle that invisible markup tags may be present.

This problem ended up being more interesting to solve than I initially thought. I used recursion to create possible layouts around word boundaries. Then sort the layouts to find the best one.

The returned result is not justified, but will straight forward to justify the text using this result as it provides the optimal starting point given the defined line length/ line count criteria.

Here is the c# code.

Reasons:
  • Blacklisted phrase (0.5): I need
  • Contains signature (1):
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: dynamicbutter