For this Question: The stock span problem is a financial problem where we have a series of n daily price quotes for a stock and we need to calculate the span of stock’s price for all n days. 
The span Si of the stock’s price on a given day i is defined as the maximum number of consecutive days just before the given day(including), for which the price of the stock on the current day is less than or equal to its price on the given day.
For example, if an array of 7 days prices is given as {100, 80, 60, 70, 60, 75, 85}, then the span values for corresponding 7 days are {1, 1, 1, 2, 1, 4, 6}.

Explanation to the given example: 
On 0th day only the current day where we find that stock price is less than or equal to it so for 1 consecutive day(current day) this happens.
On 1st day only the current day where we find that stock price is less than or equal to it so for 1 consecutive day(current day) this happens.
On 2nd day only the current day where we find that stock price is less than or equal to it so for 1 consecutive day(current day) this happens.
Now on 3rd day we observe that stock price for last two consecutive days is less than or equal to current day i.e. (60, 70) thus count is 2 
On 4th day only the current day where we find that stock price is less than or equal to it so for 1 consecutive day(current day) this happens.
On 5th day we observe that stock price for last four consecutive days is less than or equal to current day i.e. (60, 70, 60, 75) thus count is 4.
On 6th day we observe that stock price for last six consecutive days is less than or equal to current day i.e. (80, 60, 70, 60, 75, 85) thus count is 6.The first line of each test case is N, N is the size of the array. The second line of each test case contains N input A[i].

1 ≤ N ≤ 100000
1 ≤ A[i] ≤ 100000For each test case, print the span values for all days.Input
7
100 80 60 70 60 75 85

Output
1 1 1 2 1 4 6

Input
6
10 4 5 90 120 80

Output
1 1 2 4 5 1

Explanation:
Test case 1: 
On 0th day only the current day where we find that stock price is less than or equal to it so for 1 consecutive day(current day) this happens.
On 1st day only the current day where we find that stock price is less than or equal to it so for 1 consecutive day(current day) this happens.
On 2nd day only the current day where we find that stock price is less than or equal to it so for 1 consecutive day(current day) this happens.
Now on 3rd day we observe that stock price for last two consecutive days is less than or equal to current day i.e. (60, 70) thus count is 2 
On 4th day only the current day where we find that stock price is less than or equal to it so for 1 consecutive day(current day) this happens.
On 5th day we observe that stock price for last four consecutive days is less than or equal to current day i.e. (60, 70, 60, 75) thus count is 4.
On 6th day we observe that stock price for last six consecutive days is less than or equal to current day i.e. (80, 60, 70, 60, 75, 85) thus count is 6., I have written this Solution Code: n = int(input())
lst = list(map(int, input().strip().split()))
S = [0]*n
st = [] 
st.append(0) 
for i in range(n): 
	while( len(st) > 0 and lst[st[-1]] <= lst[i]): 
		st.pop() 
	S[i] = i + 1 if len(st) <= 0 else (i - st[-1]) 
	st.append(i) 
for i in range(0, n): 
	print (S[i], end =" "), In this Programming Language: Python, Now tell me if this Code is compilable or not?