Question: a)Write a python function that takes two lists as input and returns a list of common elements of the input lists. Function signature - def

a)Write a python function that takes two lists as input and returns a list of common elements of the input lists.

Function signature - def common_elements(list1:list, list2:list)->list:

b)What if the size of one of the input lists is way smaller than the other list ? Would you solve the problem differently ,if so how?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!