MaxGap ← {+/(⌈/=⊢)2-/(⊂⍤⍒⌷⊢)⍵} ⍝ Tests MaxGap 2 5 8 1 ⍝ 2