title: Program For Deadlock Free Condition In Operating System
signature: class Solution {
  
      public Integer programForDeadlockFreeConditionInOperatingSystem(Integer process, Integer need) {
source_py: def program_for_deadlock_free_condition_in_operating_system(process, need):
      minResources = 0
      minResources = ((process * (need - 1)) + 1)
      return minResources
source_cpp: int program_for_deadlock_free_condition_in_operating_system(int process, int need) {
    int minResources = 0;
    minResources = process * ( need - 1 ) + 1;
    return minResources;
  }
question_info.extension: java
question_info.entry_fn_name: programForDeadlockFreeConditionInOperatingSystem
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 1369, "inputs": {"process": 38, "need": 37}}, {"idx": 1, "outputs": 165, "inputs": {"process": 82, "need": 3}}, {"idx": 2, "outputs": 51, "inputs": {"process": 2, "need": 26}}, {"idx": 3, "outputs": 2699, "inputs": {"process": 38, "need": 72}}, {"idx": 4, "outputs": 2605, "inputs": {"process": 31, "need": 85}}, {"idx": 5, "outputs": 5761, "inputs": {"process": 80, "need": 73}}, {"idx": 6, "outputs": 89, "inputs": {"process": 11, "need": 9}}, {"idx": 7, "outputs": 61, "inputs": {"process": 2, "need": 31}}, {"idx": 8, "outputs": 1509, "inputs": {"process": 26, "need": 59}}, {"idx": 9, "outputs": 2443, "inputs": {"process": 37, "need": 67}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer process, Integer need, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(process, need,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(38, 37, 1369);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(82, 3, 165);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(2, 26, 51);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(38, 72, 2699);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(31, 85, 2605);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(80, 73, 5761);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(11, 9, 89);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(2, 31, 61);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(26, 59, 1509);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(37, 67, 2443);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer process, Integer need, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(process, need),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__