human
Count of vessels completely filled after a given time | Function to find the number of completely filled vessels.
Store the vessels.
Assuming all water is present in the vessel at the first level.
Store the number of vessel that are completely full.
Traverse all the levels.
Number of vessel at each level is j.
Calculate the exceeded amount of water.
If current vessel has less than 1 unit of water then continue.
One more vessel is full.
If left bottom vessel present.
If right bottom vessel present.
Number of levels.
Number of seconds.
Function call"
How can the above be solved in Python?
 Give me a code to count of vessels completely filled after a given time and the other steps required?
assistant
#Here is code to count of vessels completely filled after a given time and the other steps required.
 def FindNoOfFullVessels ( n , t ) :
	Matrix = [ [ 0 for i in range ( n ) ] for j in range ( n ) ]
	Matrix [ 0 ] [ 0 ] = t * 1.0
	ans = 0
	for i in range ( n ) :
		for j in range ( i + 1 ) :
			exceededwater = Matrix [ i ] [ j ] - 1.0
			if ( exceededwater < 0 ) :
				continue
			ans += 1
			if ( i + 1 < n ) :
				Matrix [ i + 1 ] [ j ] += exceededwater / 2
			if ( i + 1 < n and j + 1 < n ) :
				Matrix [ i + 1 ] [ j + 1 ] += exceededwater / 2
	return ans
N = 3
T = 4
print ( FindNoOfFullVessels ( N , T ) )