Question: Python Write a function def common_values(al,a2 a3): al and a2 and a3 are lists of int numbers. They are sorted left to right, small to

 Python Write a function def common_values(al,a2 a3): al and a2 anda3 are lists of int numbers. They are sorted left to right,

Python Write a function def common_values(al,a2 a3): al and a2 and a3 are lists of int numbers. They are sorted left to right, small to big. The function returns as a result the number of different values that each one of them appears in the 3 lists together. Example : al=[-12, -12,5,8,8,12, 12, 15, 56] a2={1,5,5,5, 7, 9, 11, 12, 12, 12, 16, 21] a3=[-4, -4,-3,-1, 2, 2, 5, 10, 10, 11, 11, 11, 12, 12, 27, 29] 9 2 we get common_values(al, a2, a3)=2 we can find the values 5 and 12 in the 3 lists. Requirements : The function should be efficient in time and space

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!