Skip to content

Commit aa8858b

Browse files
authored
Var size is redunant (TheAlgorithms#2139)
1 parent 183784b commit aa8858b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

DynamicProgramming/RodCutting.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ private static int cutRod(int[] price, int n) {
2323
// main function to test
2424
public static void main(String args[]) {
2525
int[] arr = new int[] {2, 5, 13, 19, 20};
26-
int size = arr.length;
27-
int result = cutRod(arr, size);
26+
int result = cutRod(arr, arr.length);
2827
System.out.println("Maximum Obtainable Value is " + result);
2928
}
3029
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy