the solution of the AbsDistinct