Add 'distinct' method for arrays.