exercise 3.24 : List.hasSubsequence()