Sir i've solved this question and my code is correct but i'm unable to submit it. i don't know why whenever i press submit button it doesn't complie

code goes here --:
from sys import *

setrecursionlimit(10**5+1)

inf=int(10 ** 20)

max_val=inf

min_val=-inf

def si(): return stdin.readline()

def mi(): return map(int,si().split())

def li(): return list(mi())

N, K = mi()

arr = li()

forward = [0 for _ in range(N)]

backwrd = [0 for _ in range(N)]

backwrd[0] = arr[0]

backwrd[1] = arr[0] + arr[1]

for i in range(2, N):
backwrd[i] = arr[i] + max(backwrd[i - 1], backwrd[i - 2])

for i in range(K, N):
forward[i] = arr[i] + max(forward[i - 1], forward[i - 2])

ans = min_val

for i in range(K - 1, N):

ans = max(ans, forward[i] + backwrd[i] - arr[i])

print(ans)

Hey @coding_daddy
Seems like you experienced some IDE issue
The server is experiencing too much load due too many people using it at once
You can try to submit a little later
If the issue persists please mail [email protected]

If your doubt is resolved please close it

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.