Trapping Rain Water || Best optimization || O(N) Time O(1) space || Intuition with Code and Example

Описание к видео Trapping Rain Water || Best optimization || O(N) Time O(1) space || Intuition with Code and Example

Given an array arr[] of N non-negative integers representing the height of blocks. If width of each block is 1, compute how much water can be trapped between the blocks during the rainy season.
Input:
N = 6
arr[] = {3,0,0,2,0,4}
Output:
10
Explanation:

Комментарии

Информация по комментариям в разработке