More practice questions

More questions, by popular demand.
  1. Given a list L of integers and a set S on integers, determine how many elements of S occur in L.
  2. Given a list L, determine the number of distinct elements in L that are divisible by 3. E.g., for the list [1,2,3,3,6,9] the answer is 3.
  3. Write a procedure that takes a positive integer n as input and returns the set {-1,-2,...,-n}