which container will contain least amount of water
Answers
Answered by
0
Answer:
pls mention the whole QUESTION
RIEEJ. .
Explanation:
i think CONTAINER WHICH HAS MORE VOLUME and mass . I THINK IT IS RIGHT
Answered by
0
Answer:
Create a nested loop, the outer loop traverses the array from 0 to end (index of this loop is i).
The inner loop traverses the array from i + 1 to end (index of this loop is j).
Find the water that can be contained in the container with height of boundaries as array[i] and array[j], i.e area = (j – i)* min(array[i],array[j]), if this area is greater than current maximum, update the current maximum
Print the current maximum.
Similar questions