How do you find duplicate elements in a list in Python?
Interview insights are lockedSee how often this is asked and which companies asked it with Buncho Pro.Write a function that returns the duplicated values in a list. Aim for O(n) time and show a one-liner alternative.