human
Maximum water that can be stored between two buildings | Return the maximum water that can be stored.
To store the maximum water so far.
Both the pointers are pointing at the first and the last buildings respectively.
While the water can be stored between the currently chosen buildings.
Update maximum water so far and increment i.
Update maximum water so far and decrement j.
Any of the pointers can be updated ( or both ).
Driver code"
How can the above be solved in Python?
 Can you provide a code to maximum water that can be stored between two buildings and the other steps required?
assistant
#Here is code to maximum water that can be stored between two buildings and the other steps required.
 def maxWater ( height , n ) :
	maximum = 0 ;
	i = 0
	j = n - 1
	while ( i < j ) :
		if ( height [ i ] < height [ j ] ) :
			maximum = max ( maximum , ( j - i - 1 ) * height [ i ] ) ;
			i += 1 ;
		elif ( height [ j ] < height [ i ] ) :
			maximum = max ( maximum , ( j - i - 1 ) * height [ j ] ) ;
			j -= 1 ;
		else :
			maximum = max ( maximum , ( j - i - 1 ) * height [ i ] ) ;
			i += 1 ;
			j -= 1 ;
	return maximum ;
height = [ 2 , 1 , 3 , 4 , 6 , 5 ]
n = len ( height )
print ( maxWater ( height , n ) ) ;