Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started