find duplicate and missing elements