title: Number Ordered Pairs Ai Aj 0
signature: number_ordered_pairs_ai_aj_0 <- function(a, n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(a, n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(a, n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          list(17L, 20L, 32L, 35L, 35L, 36L, 43L, 47L, 59L, 59L, 68L, 69L, 70L, 70L, 75L, 82L, 88L, 94L, 96L, 99L), 17L, 
          54L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(-78L, -40L, 58L, -36L, 34L, -12L, -38L, 48L, -66L, 16L, 50L, -26L, -22L, 46L, -70L, -68L, -44L, -52L, -78L, -50L), 11L, 
          6L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 23L, 
          506L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          list(49L, 57L, 17L, 37L, 56L, 61L, 10L, 3L, 33L, 33L, 70L, 35L, 50L, 85L, 48L, 65L, 83L, 21L, 96L, 19L, 66L, 43L, 69L, 17L, 60L, 87L, 82L, 3L, 83L, 44L, 63L, 19L, 55L, 58L, 77L, 76L, 50L, 96L), 37L, 
          172L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          list(-94L, -88L, -86L, -80L, -80L, -72L, -64L, -60L, -58L, -58L, -58L, -50L, -44L, -32L, -8L, -8L, 0L, 6L, 8L, 10L, 14L, 14L, 18L, 28L, 34L, 34L, 46L, 54L, 56L, 56L, 56L, 64L, 66L, 66L, 70L, 82L, 84L, 88L, 96L), 33L, 
          266L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          list(1L, 1L, 1L, 0L, 1L, 0L, 1L, 1L, 0L, 0L, 1L, 0L, 1L, 0L, 1L, 1L, 0L), 13L, 
          100L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          list(1L, 3L, 10L, 11L, 13L, 14L, 15L, 17L, 20L, 25L, 26L, 26L, 27L, 29L, 32L, 36L, 36L, 36L, 42L, 46L, 47L, 49L, 51L, 54L, 54L, 55L, 60L, 66L, 67L, 68L, 68L, 68L, 72L, 77L, 78L, 79L, 83L, 84L, 92L, 98L), 32L, 
          238L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          list(-76L, -72L, 16L, 38L, -60L, 44L, -2L, -76L, -76L, -56L, 40L, 36L, 50L, -50L, -32L, 48L, -96L, 80L, 84L, 60L, 84L, 38L, -54L, -42L, 48L, 30L, 66L, -62L, -52L, -94L, 64L, -16L, 54L, 98L), 28L, 
          116L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          list(0L, 0L, 1L, 1L, 1L, 1L), 5L, 
          14L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          list(63L, 82L, 22L, 84L, 11L, 62L, 18L, 43L, 57L, 25L, 4L, 27L, 62L, 46L, 55L, 16L, 1L, 9L, 10L, 73L, 36L, 80L, 95L, 87L, 47L, 64L, 27L, 25L, 70L), 22L, 
          108L
      )))
  
  }
  
  main()
source_py: def number_ordered_pairs_ai_aj_0(a, n):
      count = 0
      for i in range(0, n):
          for j in range((i + 1), n):
              if ((a[i] & a[j]) == 0):
                  count += 2
      return count
source_cpp: int number_ordered_pairs_ai_aj_0(vector<int> a, int n) {
    int count = 0;
    for ( int i = 0;
    i < n;
    i ++ ) {
      for ( int j = i + 1;
      j < n;
      j ++ ) if ( ( a [ i ] & a [ j ] ) == 0 ) count += 2;
    }
    return count;
  }