79211438

Date: 2024-11-21 13:52:00
Score: 0.5
Natty:
Report link

You could convert them to to sets and use the bitwise operator/logical(&) to effectively combine to 2 lists and meet your criteria.

def find_common_elements(list1 :list, list2:list):
    set1 = set(list1)
    set2 = set(list2)
    
    return list(set1 & set2)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Mippy