#54
Partition a Sequence
 

Difficulty:Medium
Topics:seqs core-functions


Write a function which returns a sequence of lists of x items each. Lists of less than x items should not be returned.
test not run
(= (__ 3 (range 9)) '((0 1 2) (3 4 5) (6 7 8)))
test not run
(= (__ 2 (range 8)) '((0 1) (2 3) (4 5) (6 7)))
test not run
(= (__ 3 (range 8)) '((0 1 2) (3 4 5)))
Special Restrictions
  • partition
  • partition-all


  • Code which fills in the blank: