array find duplicate + list sort