title: Find Three Element From Different Three Arrays Such That That A B C K
signature: def findThreeElementFromDifferentThreeArraysSuchThatThatABCK(a1: List[Int], a2: List[Int], a3: List[Int], n1: Int, n2: Int, n3: Int, sum: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Boolean , expected: Boolean): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(a1: List[Int], a2: List[Int], a3: List[Int], n1: Int, n2: Int, n3: Int, sum: Int, expected: Boolean): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(a1, a2, a3, n1, n2, n3, sum),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        List(4, 9, 10, 19, 24, 25, 26, 30, 36, 43, 44, 49, 52, 62, 66, 69, 72, 77, 80, 80, 82, 84, 90, 93, 94, 98), List(4, 8, 17, 20, 22, 25, 27, 30, 31, 33, 35, 35, 38, 41, 49, 51, 60, 61, 66, 67, 69, 82, 84, 85, 86, 88), List(12, 14, 17, 20, 22, 27, 29, 31, 32, 38, 41, 43, 56, 59, 59, 64, 66, 67, 68, 69, 71, 76, 83, 83, 85, 99), 25, 18, 16, 222, 
        false    
      )}")   
  
  
      println(s"TEST-1...${driver(
        List(-24, -80, -72, 80, -96, -94, 64, 18, 12, 16, 74, 16, 54, 66, -96, -90, 54, 72, -32, -2, 90, -18, -98, 12, -42, -30, -82, -56, -86, 40), List(30, -60, -24, 18, 40, 44, -40, 62, 66, -38, 50, -74, -42, -86, -82, -8, 50, -72, -2, -48, -38, -20, -8, 56, -32, 68, 94, 80, -48, 0), List(-24, 80, 50, -56, -92, 20, 86, -42, -30, 96, 40, -32, -64, 54, -38, -72, -70, 54, -28, 98, 60, 98, -12, -30, -30, 68, -66, 68, -58, 52), 26, 22, 20, 21, 
        false    
      )}")   
  
  
      println(s"TEST-2...${driver(
        List(0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), List(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1), List(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1), 14, 14, 14, 2, 
        true    
      )}")   
  
  
      println(s"TEST-3...${driver(
        List(28, 15, 21, 28, 85, 68, 24), List(57, 46, 47, 49, 16, 81, 60), List(76, 49, 6, 44, 71, 24, 57), 6, 5, 5, 73, 
        true    
      )}")   
  
  
      println(s"TEST-4...${driver(
        List(-86, -82, -66, -44, -44, -38, -22, -6, -2, 14, 26, 40, 54, 58, 60, 66, 72, 80, 94, 96, 98), List(-96, -86, -74, -56, -52, -42, -32, -22, -16, -10, -4, -4, 10, 42, 48, 52, 58, 62, 84, 90, 96), List(-92, -92, -90, -82, -62, -44, -42, -40, -38, -36, -22, -20, -8, 12, 22, 26, 30, 44, 54, 64, 86), 13, 20, 17, 6, 
        true    
      )}")   
  
  
      println(s"TEST-5...${driver(
        List(1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1), List(0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1), List(1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0), 25, 25, 23, 0, 
        true    
      )}")   
  
  
      println(s"TEST-6...${driver(
        List(44, 53, 85, 85, 86, 88, 93), List(4, 5, 8, 15, 29, 40, 91), List(30, 53, 71, 75, 76, 82, 84), 5, 3, 4, 3, 
        false    
      )}")   
  
  
      println(s"TEST-7...${driver(
        List(70, -38, 62, -34, 74, -32, -58, -34, -54), List(48, -86, -18, 14, 88, 92, -56, -8, -74), List(8, 8, 32, 76, 76, 94, 22, -60, -42), 6, 6, 6, 7, 
        false    
      )}")   
  
  
      println(s"TEST-8...${driver(
        List(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), List(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1), List(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1), 15, 14, 10, 13, 
        false    
      )}")   
  
  
      println(s"TEST-9...${driver(
        List(41, 64, 39, 96, 54, 54, 57, 4, 82, 43, 44, 56, 1), List(44, 58, 40, 87, 22, 82, 8, 81, 88, 42, 15, 14, 81), List(64, 20, 24, 42, 37, 46, 6, 47, 12, 93, 8, 5, 11), 7, 8, 6, 10, 
        false    
      )}")   
  
  }
  
source_py: def find_three_element_from_different_three_arrays_such_that_that_a_b_c_k(a1, a2, a3, n1, n2, n3, sum):
      for i in range(0, n1):
          for j in range(0, n2):
              for k in range(0, n3):
                  if (((a1[i] + a2[j]) + a3[k]) == sum):
                      return True
      return False
source_cpp: bool find_three_element_from_different_three_arrays_such_that_that_a_b_c_k(vector<int> a1, vector<int> a2, vector<int> a3, int n1, int n2, int n3, int sum) {
    for ( int i = 0;
    i < n1;
    i ++ ) for ( int j = 0;
    j < n2;
    j ++ ) for ( int k = 0;
    k < n3;
    k ++ ) if ( a1 [ i ] + a2 [ j ] + a3 [ k ] == sum ) return true;
    return false;
  }