Skip to main content
added 111 characters in body
Source Link
chunes
  • 27.8k
  • 3
  • 32
  • 55

Factor + grouping.extras, 36 bytes

[ [ ] group-by values all-shortest ] 

Try it online!

  • [ ] group-by values Split a sequence into groups of contiguous equal elements.
  • all-shortest Take all the shortest groups.

[ stable-slices all-shortest ] would work except it doesn't have the right behavior for 1-element inputs.

Factor + grouping.extras, 36 bytes

[ [ ] group-by values all-shortest ] 

Try it online!

  • [ ] group-by values Split a sequence into groups of contiguous equal elements.
  • all-shortest Take all the shortest groups.

Factor + grouping.extras, 36 bytes

[ [ ] group-by values all-shortest ] 

Try it online!

  • [ ] group-by values Split a sequence into groups of contiguous equal elements.
  • all-shortest Take all the shortest groups.

[ stable-slices all-shortest ] would work except it doesn't have the right behavior for 1-element inputs.

Source Link
chunes
  • 27.8k
  • 3
  • 32
  • 55

Factor + grouping.extras, 36 bytes

[ [ ] group-by values all-shortest ] 

Try it online!

  • [ ] group-by values Split a sequence into groups of contiguous equal elements.
  • all-shortest Take all the shortest groups.