MCPcopy Create free account
hub / github.com/Ayush7614/Daily-Coding-DS-ALGO-Practice / main

Method main

Leetcode/Java/RodCutting.java:3–15  ·  view source on GitHub ↗
(String args[])

Source from the content-addressed store, hash-verified

1import java.util.*;
2class Main {
3 public static void main(String args[])
4 {
5 Scanner in = new Scanner(System.in);
6 System.out.println("Enter pieces: ");
7 int size = in.nextInt();
8 System.out.println("Enter price: ");
9 int arr[] = new int[size];
10 for(int i=0;i<size; i++)
11 {
12 arr[i] = in.nextInt();
13 }
14 System.out.println("Maximum Obtainable Value is " + rodcut(arr, size));
15 }
16 static int rodcut(int price[], int n)
17 {
18 if (n <= 0)

Callers

nothing calls this directly

Calls 1

rodcutMethod · 0.95

Tested by

no test coverage detected