Hi, I have a list numbers say,


First, I want to calculate the sum of the differences between the numbers
in the list.
Second, if a sequence of numbers having a difference of 1, put them in a
list, i.e. there are two such lists,



and also put the rest numbers in another list, i.e. there is only one such
list in the example,


Third, get the lists with the max/min sizes from above, i.e. in this
example, the max list is,


min list is


What's the best way to implement this?


Reply via email to