Hi Siyi, very nice code, just have one question, if I want to allow one missing spot between consecutive number, what will you do it? for example: v=[1 2 3 5 6 7 11 12 13 15 16 18 19 21] want to break down to [1 2 3 4 6 7],[11 12 13 15 16 18 19 21]. Thanks. TY
3 comments:
Very neat - thank you!!
Hi Siyi,
very nice code, just have one question, if I want to allow one missing spot between consecutive number, what will you do it?
for example:
v=[1 2 3 5 6 7 11 12 13 15 16 18 19 21]
want to break down to [1 2 3 4 6 7],[11 12 13 15 16 18 19 21].
Thanks. TY
find a typo here, it is actually [1 2 3 5 6 7] and [11 12 13 15 16 18 19 21].
Post a Comment