Would this work for strings like "834567"? I think you may need to replace ($seq.comb Z $seq.comb.rotate) with something like ($seq.comb[0..*-2] Z $seq.comb[1..*-1]).
In reply to Re^2: Find Length Of Longest Ascending/Descending Sequence
by ambrus
in thread Find Length Of Longest Ascending/Descending Sequence
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |