Using the Two-Pointer Kotlin Approach to Solve for the Container with the Most Waterby@okyrcheuskaya

Using the Two-Pointer Kotlin Approach to Solve for the Container with the Most Water

tldt arrow
Read on Terminal Reader🖨️

Too Long; Didn't Read

The problem is asking to find the maximum amount of water that can be stored in a container formed by two lines on a 2-dimensional plane and the x-axis. The two lines are represented by an integer array "height" where the ith element is the height of the line at the itH position. We then calculate the area between the two lines represented by the pointers using the formula.
featured image - Using the Two-Pointer Kotlin Approach to Solve for the Container with the Most Water
Volha Kurcheuskay HackerNoon profile picture

@okyrcheuskaya

Volha Kurcheuskay

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa