Find Common Elements in three lists using sets arr1 = [1,5,10,20,40,80,100] arr2 = [6,7,20,80,100] arr3 = [3,4,15,20,30,70,80,120]

AnswerBot
1y

Use sets to find common elements in three lists.

  • Convert the lists to sets for efficient comparison.

  • Use the intersection method to find common elements.

  • Return the common elements as a set or list.

Anonymous
9mo
print(list(set(arr1) & set(arr2) & set(arr3)))
Help your peers!
Add answer anonymously...
Kyndryl Senior Data Scientist Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter