2
def minSideJumps(self, obstacles: List[int]) -> int:6
def dp(curr_lane = 2, point = 0):7
if point == len(obstacles)-1:9
if obstacles[point+1] == curr_lane:10
return min(dp(lane, point+1) for lane in range(1, 4) if obstacles[point+1] != lane and obstacles[point]!=lane) + 112
return dp(curr_lane, point+1)20
dp = [[0, 0, 0, 0] for _ in range(n)]22
for point in range(n - 2, -1, -1):23
for curr_lane in range(4):24
if obstacles[point + 1] == curr_lane:25
dp[point][curr_lane] = (28
for lane in range(1, 4)29
if obstacles[point + 1] != lane and obstacles[point] != lane34
dp[point][curr_lane] = dp[point + 1][curr_lane]