Skip to content

Instantly share code, notes, and snippets.

@TrevorS
Created September 30, 2014 20:46
Show Gist options
  • Save TrevorS/621be793c80c36efac58 to your computer and use it in GitHub Desktop.
Save TrevorS/621be793c80c36efac58 to your computer and use it in GitHub Desktop.
[1, 2, 3, 7, 8, 11, 12, 13].enum_for(:chunk).with_index { |x, index| x - index }.map { |diff, group| [group.first, group.last] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment