title: Find Three Element From Different Three Arrays Such That That A B C K
signature: find_three_element_from_different_three_arrays_such_that_that_a_b_c_k <- function(a1, a2, a3, n1, n2, n3, sum) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(a1, a2, a3, n1, n2, n3, sum, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(a1, a2, a3, n1, n2, n3, sum), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          list(4L, 9L, 10L, 19L, 24L, 25L, 26L, 30L, 36L, 43L, 44L, 49L, 52L, 62L, 66L, 69L, 72L, 77L, 80L, 80L, 82L, 84L, 90L, 93L, 94L, 98L), list(4L, 8L, 17L, 20L, 22L, 25L, 27L, 30L, 31L, 33L, 35L, 35L, 38L, 41L, 49L, 51L, 60L, 61L, 66L, 67L, 69L, 82L, 84L, 85L, 86L, 88L), list(12L, 14L, 17L, 20L, 22L, 27L, 29L, 31L, 32L, 38L, 41L, 43L, 56L, 59L, 59L, 64L, 66L, 67L, 68L, 69L, 71L, 76L, 83L, 83L, 85L, 99L), 25L, 18L, 16L, 222L, 
          FALSE
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(-24L, -80L, -72L, 80L, -96L, -94L, 64L, 18L, 12L, 16L, 74L, 16L, 54L, 66L, -96L, -90L, 54L, 72L, -32L, -2L, 90L, -18L, -98L, 12L, -42L, -30L, -82L, -56L, -86L, 40L), list(30L, -60L, -24L, 18L, 40L, 44L, -40L, 62L, 66L, -38L, 50L, -74L, -42L, -86L, -82L, -8L, 50L, -72L, -2L, -48L, -38L, -20L, -8L, 56L, -32L, 68L, 94L, 80L, -48L, 0L), list(-24L, 80L, 50L, -56L, -92L, 20L, 86L, -42L, -30L, 96L, 40L, -32L, -64L, 54L, -38L, -72L, -70L, 54L, -28L, 98L, 60L, 98L, -12L, -30L, -30L, 68L, -66L, 68L, -58L, 52L), 26L, 22L, 20L, 21L, 
          FALSE
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L), 14L, 14L, 14L, 2L, 
          TRUE
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          list(28L, 15L, 21L, 28L, 85L, 68L, 24L), list(57L, 46L, 47L, 49L, 16L, 81L, 60L), list(76L, 49L, 6L, 44L, 71L, 24L, 57L), 6L, 5L, 5L, 73L, 
          TRUE
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          list(-86L, -82L, -66L, -44L, -44L, -38L, -22L, -6L, -2L, 14L, 26L, 40L, 54L, 58L, 60L, 66L, 72L, 80L, 94L, 96L, 98L), list(-96L, -86L, -74L, -56L, -52L, -42L, -32L, -22L, -16L, -10L, -4L, -4L, 10L, 42L, 48L, 52L, 58L, 62L, 84L, 90L, 96L), list(-92L, -92L, -90L, -82L, -62L, -44L, -42L, -40L, -38L, -36L, -22L, -20L, -8L, 12L, 22L, 26L, 30L, 44L, 54L, 64L, 86L), 13L, 20L, 17L, 6L, 
          TRUE
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          list(1L, 1L, 1L, 0L, 1L, 1L, 1L, 0L, 0L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 0L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, 1L, 0L, 1L, 1L, 1L, 0L, 0L, 1L, 0L, 1L), list(0L, 1L, 1L, 1L, 1L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, 1L, 1L, 0L, 1L, 0L, 1L), list(1L, 0L, 1L, 0L, 0L, 0L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 0L, 0L, 0L, 1L, 1L, 0L, 0L, 1L, 1L, 1L, 0L, 1L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 0L, 0L), 25L, 25L, 23L, 0L, 
          TRUE
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          list(44L, 53L, 85L, 85L, 86L, 88L, 93L), list(4L, 5L, 8L, 15L, 29L, 40L, 91L), list(30L, 53L, 71L, 75L, 76L, 82L, 84L), 5L, 3L, 4L, 3L, 
          FALSE
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          list(70L, -38L, 62L, -34L, 74L, -32L, -58L, -34L, -54L), list(48L, -86L, -18L, 14L, 88L, 92L, -56L, -8L, -74L), list(8L, 8L, 32L, 76L, 76L, 94L, 22L, -60L, -42L), 6L, 6L, 6L, 7L, 
          FALSE
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 15L, 14L, 10L, 13L, 
          FALSE
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          list(41L, 64L, 39L, 96L, 54L, 54L, 57L, 4L, 82L, 43L, 44L, 56L, 1L), list(44L, 58L, 40L, 87L, 22L, 82L, 8L, 81L, 88L, 42L, 15L, 14L, 81L), list(64L, 20L, 24L, 42L, 37L, 46L, 6L, 47L, 12L, 93L, 8L, 5L, 11L), 7L, 8L, 6L, 10L, 
          FALSE
      )))
  
  }
  
  main()
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;
  }