Given a list of integers, we want to keep only the non-unique elements in this list. To do this, we need to remove all the unique elements (elements that appear only once). The resulting list, denoted by C, must not change the order of the original list. Complete the function dupe(L) which returns the new list C.
Example:
  • If L=[1,2,3,1,3] then C=[1,3,1,3]
  • If L=[1,2,3,4,5] then C=[]
  • If L=[5,5,5] then C=[5,5,5]
  • If L=[10,9,10,10,9,8] then C=[10,9,10,10,9]

Solution Stats

47 Solutions

22 Solvers

Last Solution submitted on Mar 09, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...