Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • $\begingroup$ Actually, partitions[list,2] on its own appears to do the job just fine and about two times as fast as my solution. Simply use Map[list[[#]]&,partitions[Range... as I mentioned under ciao's answer. $\endgroup$ Commented Jul 14, 2015 at 14:14
  • $\begingroup$ @LLlAMnYP That sounds like a much better idea. I'll write it up later and replace this mess. Thank you! $\endgroup$ Commented Jul 15, 2015 at 0:12
  • $\begingroup$ ciao also warns that Map is quite slow to replace indices with elements, but see the comment thread under his answer for details :-) $\endgroup$ Commented Jul 15, 2015 at 0:30