Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. isSeq ::[Int]->Bool
  2. isSeq [] = False
  3. isSeq [x] = False
  4. isSeq [x,y] = True
  5. isSeq (x:y:z:xs) = (x - y) == (y - z) && isSeq (y:z:xs)
  6.  
  7. getArithSeqs :: [[Int]]->[[Int]]
  8. getArithSeqs array = filter isSeq array
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement