I don't know your definition of "duplicated records", but with assuming "records with the same sobject type (Account) and name", you just use Map . Map doesn't allow same keys, and O(1) to get a object with using the key. You may need a logic to determine which record of duplicated 2. If it kis just to delete, Map.values() is useful to get the all objects at the end. - ThomasTT



