This challenge is from Talent Buddy:Tweets per secondJapan Castle in the Sky airing broke a Twitter  record on August 3, 2013. At one point during the classic anime movie  showing, people submitted 143,199 tweets per second. This particular  spike was about 25 times greater than Twitters steady state.Given an array of integers representing the number of tweets recorded  every second and an integer value K, your task is to write a function  that prints to the standard output (stdout) the highest number of  tweets recorded between each second in the array and the past K  seconds before it Note that your function will receive the following  arguments: tps, which is an array of integers representing the number  of tweets recorded every second, and k, which is the integer number  mentioned above. Data constraints: the length of the array above will  not exceed 500,000 numbersEfficiency constraints: your function is  expected to print the requested result and return in less than 2  seconds Example Inputtps: 6, 9, 4, 7, 4, 1k: 3 Output6 9 9 9 7 7Please Note: The above program should run in below 2 secondsMy Program start=1for i,j in enumerate(tps):    if start<=k:        print max(tps[:start])        start+=1    else:        print max(tps[i-(start)+2:i+1])This function takes more than 2 seconds for the test case.How can we do same thing less in than 2 seconds? How can this be optimized to make it faster?
Tweets per second
python;performance;programming challenge;interval