Nov-25-2017, 01:40 PM
i'm solving a task on codefights.com, it's the following: given a long line and a number, split the line into tokens where each token has length of at most the given number, and each token can be two or more words if their total length us less than the given number. for example, if s = "this is an example feedback", n = 8, then the returned value should be ["this is", "an", "example", "feedback"].
here's the link to the task: https://codefights.com/arcade/python-arc...k69Jm3gNnm
this is the code i should complete:
import ... def feedbackReview(feedback, size): return ...the ellipsis is what i can replace. so i guess i need to
import re
, but how should i split the line into tokens using that regex? i can't figure out the regex