partition = l[part_num]
start = random.randint(0, len(partition) - k)
result.append(partition[start:start + k])
l.remove(partition)
l.extend([partition[:start], partition[start + k:]])
return f([part for part in l if len(part) >= k], k, m, result)
Random sampling of non-overlapping substrings of length k