fork download
  1. import random
  2. len_arr = 20
  3. s = list(x for x in range(len_arr))
  4. arr = []
  5. while len(s) > 0:
  6. rnd_fucktor = random.randrange(1, len(s)+1)
  7. arr += [s[0:rnd_fucktor]]
  8. del s[0:rnd_fucktor]
  9. print(arr)# your code goes here
Success #stdin #stdout 0.03s 10976KB
stdin
Standard input is empty
stdout
[[0, 1, 2, 3, 4, 5], [6, 7], [8], [9, 10, 11, 12, 13, 14, 15, 16, 17], [18], [19]]