Sir maine ye ques solve kiya dp se par isme run error aa rha hai or sir isme error nahi aana chahiye . actually sir m doubt to puchta hu par kbhi reply nahi aata or likh rkha hai 24*7 support

from sys import *
from math import *
from collections import defaultdict as dt
setrecursionlimit(int(1e6)+1)
mod=10**9+7
def si(): return stdin.readline()
def mi():return map(int,si().split())
def li():return list(mi())
n=int(si());a=li()
if(n<0):print(0)
elif(n==1):print(a[0])
elif(n==2):print(max(a[0],a[1],a[0]+a[1]))
else:
dp=[0]*n
dp[0]=a[0]
dp[1]=a[0]+a[1]
dp[2]=max(a[0]+a[1],a[0]+a[2],a[1]+a[2])
for i in range(3,n):
dp[i]=max(max(dp[i-1],dp[i-2]+a[i]),a[i]+a[i-1]+dp[i-3])
print(dp[n-1])

sry sir gussa krne pe

@coding_daddy you have shared the code in python which im not familiar with .can u share it in c++?
On running this code u r getting IndentationError: expected an indented block. As the error message indicates, you have an indentation error. It is probably caused by a mix of tabs and spaces.