Click here to see the full article post
double A = new double;?
double A = new double; is also ACed since the given contraint:
query_glass and query_row will be in the range of [0, 99].
@terminator123456 we take the min because if it's over 1 it would inevitably overflow to the glasses below, but no reason to calculate that as we already found out that the glass we are querying is already going to be full.
@terminator123456 Because this algorithms consider the flow through each glasses, so to some glasses, the flow would be over 1. But the answer to the question is full = 1, so the answer is selected between the min value of 1 and flow q
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.