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

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

by Volha Kurcheuskay2mJanuary 31st, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

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
Volha Kurcheuskay

Volha Kurcheuskay

@okyrcheuskaya

Android developer

L O A D I N G
. . . comments & more!

About Author

Volha Kurcheuskay HackerNoon profile picture
Volha Kurcheuskay@okyrcheuskaya
Android developer

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite