Question: what is the difference between list and set in salesforce?
Answer: A list is an ordered collection of elements that are distinguished by their indices. ... Keys and values can be any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types. A set is an unordered collection of elements that do not contain any duplicates.