title: Program For Deadlock Free Condition In Operating System
signature: def programForDeadlockFreeConditionInOperatingSystem(process: Int, need: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(process: Int, need: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(process, need),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        38, 37, 
        1369    
      )}")   
  
  
      println(s"TEST-1...${driver(
        82, 3, 
        165    
      )}")   
  
  
      println(s"TEST-2...${driver(
        2, 26, 
        51    
      )}")   
  
  
      println(s"TEST-3...${driver(
        38, 72, 
        2699    
      )}")   
  
  
      println(s"TEST-4...${driver(
        31, 85, 
        2605    
      )}")   
  
  
      println(s"TEST-5...${driver(
        80, 73, 
        5761    
      )}")   
  
  
      println(s"TEST-6...${driver(
        11, 9, 
        89    
      )}")   
  
  
      println(s"TEST-7...${driver(
        2, 31, 
        61    
      )}")   
  
  
      println(s"TEST-8...${driver(
        26, 59, 
        1509    
      )}")   
  
  
      println(s"TEST-9...${driver(
        37, 67, 
        2443    
      )}")   
  
  }
  
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;
  }