3 ms·
This will give you an upper-bound, which is the worst case. You're right that you'll end up not giving the students as much as they "should" have, but its stil
by frisco 16y ago
This will give you an upper-bound, which is the worst case. You're right that you'll end up not giving the students as much as they "should" have, but its still infinitely better than just truncating it without warning.
- pak 16y agoYou mean lower-bound. current_length should be greater than what you calculate given any my_text with >1 char words. So you will wind up giving the students more than you can fit, not less than they should have. That's just as bad as truncating without warning.