You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(i>=list.size()) return0L; // if all robot are repaired then there is no robot left to repair so return 0.
13
+
if(j>=arr.length) returnLong.MAX_VALUE; // here we check if there is no factory left for rapair robot but we have some robot to repair because we didnt pass on first condition.
14
+
15
+
if(dp[i][j]!=null) returndp[i][j]; // checking memo for already calculated result.
16
+
17
+
longx = 0;
18
+
longres = solve(list,arr,i,j+1); // option 1 - no robot will repair on jth factory
19
+
20
+
// here we check that ... from i to k will repair on jth factory and other will check with recurstion....
21
+
// for k, we will check all possible index from i+1 to array.length
0 commit comments