Question: Question 18 (Basic problem) Given a list of integers 1st, write a function repeated(1st, k) that return the number that appeared at least k times

 Question 18 (Basic problem) Given a list of integers 1st, write

Question 18 (Basic problem) Given a list of integers 1st, write a function repeated(1st, k) that return the number that appeared at least k times in the list, if more than one number satisfy this criterion then return the largest number that has at least k repeats. Return None when all numbers appeared less then k. The function has the following definition: DRORE DE def repeated (lst, k): II TT 11 Input: 1st: list of integers. k: integer. Output: The number that appeared at least k times, if more than one number satisfy that, then return the largest number. None if no number appear at least k times. Examples: >>> repeated ([3,2,3,1,4,3,2,4,1,4],3) 4 >>> repeated ([ [5,5,4,5,1,5,4,1,5,5,4,4], 2) 5 >>> repeated ([3,3,4,3,2,2,4,4],5) None TIITTI

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!