Currently I have a list with some non-repeating positive integers in it say a = [1,2,6,15,19]
What is the most idiomatic way to create a function that returns a new list that is the result of taking the modulo %x
of each element of a
without having any repeated elements in the output?
Specifically I want f(a,x)
to return [1%x,2%x,6%x,15%x,19%x]
without the repeated elements.
For example f([1,2,6,15,19],4)
would return [1,2,3]