How prefix-sum binary search makes text line-breaking O(log n) with zero allocation Post date March 31, 2026 Post author By yinhao Post categories In algorithms, JavaScript, performance, typescript