 export function maxArea(height: number[]): number {
  let L = 0;
  let R = height.length - 1;
  let res = 0;

  while (L <= R) {
    let hL = height[L];
    let hR = height[R];
    let currArea = Math.min(hL, hR) * (R - L);
    if (currArea > res) res = currArea;
    hR > hL ? L++ : R--;
  }

  return res;
};
