Whats problem with this?

hello @garganshul151

use long long for dp array and function return type

also why this is not giving right answer when i initialise dp array with -1 instead of 0?

intiialise dp array using loop or memeset function and then try,

int dp[100]={-1} // this will intiialse only indx 0 with -1 other values will remain 0

why only 0th index it initialise with -1?

u r giving only one -1 in the {} thats why