in reply to Re^2: Adjacent numbers
in thread Adjacent numbers

It'll take a little more than that.

It will need to remember the direction in which the numbers are running, otherwise 1,2,1,2,3,2,3,4,3... will be seen as a run.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^4: Adjacent numbers
by soonix (Chancellor) on Nov 20, 2015 at 12:06 UTC
    otherwise 1,2,1,2,3,2,3,4,3... will be seen as a run.
    well, they are adjacent, after all. The OP would have to specify, whether e.g 2,3,1 should be treated as group, or not.
    In other words, whether a preceding sort step could distort the desired outcome.
      The OP would have to specify, whether e.g 2,3,1 should be treated as group, or not.

      From the OPs sample data, I think his intent is clear; but your interpretation is a possibility I suppose.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.