Skip to content

[Two Pointer] Trapping Rain Water #9

@sudosf

Description

@sudosf

Problem

Given an array of heights representing an elevation map, compute how much water can be trapped after rain.

References

Difficulty

🔴 Hard

Companies

Google, Goldman Sachs, Sumo Logic

Notes

Language: Java
Multiple approaches: O(n) space prefix arrays, or O(1) space two-pointer. Understand both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    arraysArray problemshardHard difficultytwo-pointersTwo pointer pattern

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions