diff --git a/GeeksForGeeks/April/08-4-24/GFG.java b/GeeksForGeeks/April/08-4-24/GFG.java new file mode 100644 index 0000000..d213b02 --- /dev/null +++ b/GeeksForGeeks/April/08-4-24/GFG.java @@ -0,0 +1,63 @@ +//{ Driver Code Starts +import java.util.*; +import java.io.*; +import java.lang.*; + +class OptimalStrategy +{ + public static void main (String[] args) { + + //taking input using Scanner class + Scanner sc = new Scanner(System.in); + + //taking total number of testcases + int t = sc.nextInt(); + + while(t-- > 0) + { + //taking number of elements + int n = sc.nextInt(); + int arr[] = new int[n]; + + //inserting the elements + for(int i = 0; i < n; i++) + arr[i] = sc.nextInt(); + + //calling the countMaximum() method of class solve + System.out.println(new solve().countMaximum(n, arr)); + } + } + + +} +// } Driver Code Ends + + + +class solve +{ + //Function to find the maximum possible amount of money we can win. + static long countMaximum(int n, int arr[]) + { + // Your code here + int[][] dp = new int[n][n]; + + for(int m=0; m