Algorithm to divide text into 3 evenly-sized groups

后端 未结 4 1464
小蘑菇
小蘑菇 2021-01-15 04:07

I\'m would like to create an algorithm that will divide text into 3-evenly sized groups (based on text length). Since this will be put to use for line-breaks, the order of

4条回答
  •  一整个雨季
    2021-01-15 04:23

    You can try the next simple heuristic for starters: Place to iterators in n/3 and 2n/3 and search for the closest space near each of them.

提交回复
热议问题