title: Dynamic Programming High Effort Vs Low Effort Tasks Problem
signature: class Solution {
  
      public Integer dynamicProgrammingHighEffortVsLowEffortTasksProblem(ArrayList<Integer> high, ArrayList<Integer> low, Integer n) {
source_py: def dynamic_programming_high_effort_vs_low_effort_tasks_problem(high, low, n):
      if (n <= 0):
          return 0
      return max((high[(n - 1)] + dynamic_programming_high_effort_vs_low_effort_tasks_problem(high, low, (n - 2))), (low[(n - 1)] + dynamic_programming_high_effort_vs_low_effort_tasks_problem(high, low, (n - 1))))
source_cpp: int dynamic_programming_high_effort_vs_low_effort_tasks_problem(vector<int> high, vector<int> low, int n) {
    if ( n <= 0 ) return 0;
    return max ( high [ n - 1 ] + dynamic_programming_high_effort_vs_low_effort_tasks_problem ( high, low, ( n - 2 ) ), low [ n - 1 ] + dynamic_programming_high_effort_vs_low_effort_tasks_problem ( high, low, ( n - 1 ) ) );
  }
question_info.extension: java
question_info.entry_fn_name: dynamicProgrammingHighEffortVsLowEffortTasksProblem
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 537, "inputs": {"high": [1, 3, 9, 10, 13, 14, 15, 15, 17, 22, 23, 28, 30, 31, 37, 42, 45, 62, 62, 68, 68, 68, 78, 79, 82, 84, 87, 90, 99], "low": [5, 10, 11, 14, 16, 22, 24, 30, 34, 35, 37, 37, 39, 41, 42, 42, 43, 55, 57, 63, 71, 76, 83, 83, 85, 90, 91, 97, 99], "n": 18}}, {"idx": 1, "outputs": 452, "inputs": {"high": [-78, -12, 26, 80, 50, 4, -80, 86, 12, -2, 18, -50, -90, 56, -50, 88, -62, 96, -44, -82, 56], "low": [-44, -14, 14, 0, 30, 78, 40, -12, -44, -16, 60, -12, -50, -66, 70, -98, -56, 48, -82, 94, 14], "n": 16}}, {"idx": 2, "outputs": 0, "inputs": {"high": [1], "low": [1], "n": 0}}, {"idx": 3, "outputs": 1261, "inputs": {"high": [21, 28, 13, 48, 26, 49, 16, 70, 81, 35, 74, 12, 97, 61, 10, 84, 94, 78, 40, 30, 30, 84, 41, 4, 95, 79, 38, 29, 9], "low": [49, 88, 25, 93, 24, 56, 47, 44, 33, 27, 86, 57, 21, 25, 64, 44, 37, 99, 36, 54, 17, 29, 37, 17, 26, 43, 61, 27, 21], "n": 25}}, {"idx": 4, "outputs": -56, "inputs": {"high": [-80, -36, -32, -20, -14, -12, 10, 12, 72], "low": [-76, -54, -50, -28, 0, 58, 70, 78, 90], "n": 4}}, {"idx": 5, "outputs": 15, "inputs": {"high": [1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1], "low": [0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1], "n": 24}}, {"idx": 6, "outputs": 784, "inputs": {"high": [1, 7, 9, 10, 13, 14, 15, 20, 23, 24, 24, 24, 26, 27, 29, 31, 32, 33, 34, 35, 46, 48, 49, 51, 51, 53, 53, 56, 56, 60, 62, 64, 64, 70, 73, 73, 73, 74, 77, 78, 79, 79, 79, 80, 86, 89, 89, 92, 98], "low": [1, 3, 3, 4, 8, 8, 10, 10, 10, 12, 12, 15, 15, 22, 23, 28, 28, 30, 31, 33, 34, 35, 36, 36, 36, 42, 44, 44, 51, 54, 57, 58, 59, 59, 63, 65, 66, 68, 69, 71, 73, 76, 77, 78, 79, 79, 86, 87, 93], "n": 31}}, {"idx": 7, "outputs": 268, "inputs": {"high": [56, 48, 40, -56, 44, -86, -28, -32, -34, 4, -94, -14, 28, -74], "low": [82, -40, -16, -64, 12, -6, 60, 48, -58, -4, 42, -28, 24, -58], "n": 8}}, {"idx": 8, "outputs": 5, "inputs": {"high": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], "low": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1], "n": 16}}, {"idx": 9, "outputs": 453, "inputs": {"high": [85, 13, 35, 57, 8, 48, 65, 54, 88, 7, 66, 30, 47, 51], "low": [1, 42, 42, 89, 3, 21, 49, 98, 4, 59, 26, 85, 53, 34], "n": 8}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(ArrayList<Integer> high, ArrayList<Integer> low, Integer n, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(high, low, n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(new ArrayList<>(Arrays.asList(1, 3, 9, 10, 13, 14, 15, 15, 17, 22, 23, 28, 30, 31, 37, 42, 45, 62, 62, 68, 68, 68, 78, 79, 82, 84, 87, 90, 99)), new ArrayList<>(Arrays.asList(5, 10, 11, 14, 16, 22, 24, 30, 34, 35, 37, 37, 39, 41, 42, 42, 43, 55, 57, 63, 71, 76, 83, 83, 85, 90, 91, 97, 99)), 18, 537);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(-78, -12, 26, 80, 50, 4, -80, 86, 12, -2, 18, -50, -90, 56, -50, 88, -62, 96, -44, -82, 56)), new ArrayList<>(Arrays.asList(-44, -14, 14, 0, 30, 78, 40, -12, -44, -16, 60, -12, -50, -66, 70, -98, -56, 48, -82, 94, 14)), 16, 452);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(1)), new ArrayList<>(Arrays.asList(1)), 0, 0);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(21, 28, 13, 48, 26, 49, 16, 70, 81, 35, 74, 12, 97, 61, 10, 84, 94, 78, 40, 30, 30, 84, 41, 4, 95, 79, 38, 29, 9)), new ArrayList<>(Arrays.asList(49, 88, 25, 93, 24, 56, 47, 44, 33, 27, 86, 57, 21, 25, 64, 44, 37, 99, 36, 54, 17, 29, 37, 17, 26, 43, 61, 27, 21)), 25, 1261);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(-80, -36, -32, -20, -14, -12, 10, 12, 72)), new ArrayList<>(Arrays.asList(-76, -54, -50, -28, 0, 58, 70, 78, 90)), 4, -56);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1)), new ArrayList<>(Arrays.asList(0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1)), 24, 15);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(1, 7, 9, 10, 13, 14, 15, 20, 23, 24, 24, 24, 26, 27, 29, 31, 32, 33, 34, 35, 46, 48, 49, 51, 51, 53, 53, 56, 56, 60, 62, 64, 64, 70, 73, 73, 73, 74, 77, 78, 79, 79, 79, 80, 86, 89, 89, 92, 98)), new ArrayList<>(Arrays.asList(1, 3, 3, 4, 8, 8, 10, 10, 10, 12, 12, 15, 15, 22, 23, 28, 28, 30, 31, 33, 34, 35, 36, 36, 36, 42, 44, 44, 51, 54, 57, 58, 59, 59, 63, 65, 66, 68, 69, 71, 73, 76, 77, 78, 79, 79, 86, 87, 93)), 31, 784);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(56, 48, 40, -56, 44, -86, -28, -32, -34, 4, -94, -14, 28, -74)), new ArrayList<>(Arrays.asList(82, -40, -16, -64, 12, -6, 60, 48, -58, -4, 42, -28, 24, -58)), 8, 268);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1)), new ArrayList<>(Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1)), 16, 5);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(85, 13, 35, 57, 8, 48, 65, 54, 88, 7, 66, 30, 47, 51)), new ArrayList<>(Arrays.asList(1, 42, 42, 89, 3, 21, 49, 98, 4, 59, 26, 85, 53, 34)), 8, 453);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(ArrayList<Integer> high, ArrayList<Integer> low, Integer n, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(high, low, n),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__