For this Question: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute volume of water it is able to trap after raining.
Please refer to Sample test case for more details.The first line of input contains the size of the array, n
The following line of input contains n space-separated integers

Constraints:-
1 <= n <= 50000
0<=A[i]<=10<sup>10</sup>The first and only line of output contains integer, in accordance to the task.Sample Input:
6
3 0 0 2 0 4
Sample Output:
10, I have written this Solution Code: def water(a,n):
	leftmin=0
	rightmax=0
	lo=0
	hi=n-1
	result=0
	while(lo<=hi):
		if a[lo]<a[hi]:
			if a[lo]<leftmin:
				result+=leftmin-a[lo]
				lo+=1
			else:
				leftmin=a[lo]
		        
				lo=lo+1
		else:
			if a[hi]>rightmax:
				rightmax=a[hi]
			else:
				result+=rightmax-a[hi]
			hi-=1
	return result

n=int(input())
b=list(input().split(" "))
a=[]
for i in b:
	if i.isnumeric():
		a.append(int(i))

print(water(a,n)), In this Programming Language: Python, Now tell me if this Code is compilable or not?