You are viewing a single comment's thread. Return to all comments →
for(int i = 1 ; i < n ;i++){ //forward track if(arr[i] > arr[i-1]){ dp[i] = dp[i] + dp[i-1]; } } for(int i = n-2 ; i >= 0 ; i--){ // back track if(arr[i] > arr[i+1] && dp[i] <= dp[i+1]){ dp[i] = dp[i+1] + 1; } } its 22 ..
Seems like cookies are disabled on this browser, please enable them to open this website
Candies
You are viewing a single comment's thread. Return to all comments →