Var size is redunant (#2139)

This commit is contained in:
Serwio YK 2021-03-14 03:41:12 +02:00 committed by GitHub
parent 183784b989
commit aa8858b57a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,8 +23,7 @@ public class RodCutting {
// main function to test // main function to test
public static void main(String args[]) { public static void main(String args[]) {
int[] arr = new int[] {2, 5, 13, 19, 20}; int[] arr = new int[] {2, 5, 13, 19, 20};
int size = arr.length; int result = cutRod(arr, arr.length);
int result = cutRod(arr, size);
System.out.println("Maximum Obtainable Value is " + result); System.out.println("Maximum Obtainable Value is " + result);
} }
} }