Solution for AbsDistinct