Skip to main content
7 events
when toggle format what by license comment
Apr 19, 2015 at 3:13 comment added VividD Thanks, performance comparison is beautiful, and also valuable info.
Apr 18, 2015 at 18:36 comment added 2012rcampion @rasher Also, the performance difference is exactly zero for lists that do have a repeat (excepting a difference of one clock cycle for the /2/>>1), and the difference is around 2x for (random) lists with no repeats.
Apr 18, 2015 at 18:27 comment added 2012rcampion @rasher I would, if not for the comments on Pickett's answer: "{1, 2, 7, 3, 5, 1} should be counted as one pattern of length six, instead of a pattern of length five" "it is not so critical to make such distinction or not, but I would think your way"
Apr 18, 2015 at 18:17 comment added ciao Please note that in your answer so readers can't miss it, and update benchmark to show the significant performance impact this change has.
Apr 18, 2015 at 18:04 comment added 2012rcampion @rasher change Quotient[n,2] to n to get that behavior.
Apr 18, 2015 at 17:54 comment added ciao Fast is nice, when it's fast and correct. This fails, e.g. {1,2,3,1,2} should return 3 per OP, this returns 5.
Apr 18, 2015 at 16:43 history answered 2012rcampion CC BY-SA 3.0