class Solution:
def trap(self, height: List[int]) -> int:
n = len(height)
mxl = []
mxr = []
mxl.append(height[0])
for i in range(1,n):
mxl[i] = max(mxl[i-1],height[i])
Line 8 gives Index error. Is it wrong way to assign value in a list at particular index?