title: Possible To Make A Divisible By 3 Number Using All Digits In An Array
signature: possible_to_make_a_divisible_by_3_number_using_all_digits_in_an_array <- function(arr, n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(arr, n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          list(2L, 4L, 9L, 11L, 12L, 15L, 16L, 19L, 21L, 21L, 23L, 23L, 24L, 30L, 31L, 31L, 32L, 34L, 37L, 41L, 41L, 43L, 45L, 46L, 47L, 54L, 58L, 60L, 62L, 66L, 66L, 74L, 74L, 75L, 75L, 77L, 77L, 85L, 89L, 90L, 92L, 92L, 93L, 95L, 98L), 30L, 
          FALSE
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(0L, 66L, 92L, 24L, -8L, 88L, -92L, 86L, 80L, 82L, 42L, -20L, -56L, -2L, -84L, 32L), 14L, 
          FALSE
      )))
  
      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, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 29L, 
          TRUE
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          list(99L, 83L, 11L, 99L, 80L, 76L, 32L, 12L, 94L, 66L, 76L), 5L, 
          TRUE
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          list(-88L, -84L, -80L, -80L, -80L, -80L, -72L, -68L, -64L, -62L, -60L, -52L, -48L, -44L, -36L, -24L, -20L, -18L, -14L, -8L, -6L, -6L, -4L, 6L, 10L, 14L, 18L, 24L, 26L, 26L, 50L, 50L, 52L, 60L, 76L, 90L, 96L, 98L), 19L, 
          TRUE
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          list(0L, 1L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, 1L, 1L, 1L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, 1L), 14L, 
          FALSE
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          list(6L, 6L, 8L, 8L, 10L, 24L, 24L, 26L, 27L, 30L, 34L, 34L, 36L, 36L, 39L, 40L, 41L, 44L, 45L, 50L, 52L, 53L, 57L, 62L, 64L, 64L, 70L, 71L, 72L, 78L, 78L, 79L, 80L, 82L, 89L, 95L, 96L), 28L, 
          FALSE
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          list(-28L, -84L, -14L, -20L, -14L, -26L, 28L, -66L, 48L, 82L, -46L, -10L, -94L, 76L, 56L, -6L, 72L, -92L, -32L, 66L, 50L, -72L, 64L, 12L, 48L, 88L, -36L, -12L, -6L, -18L, -36L, -34L, 44L, 40L, -54L), 25L, 
          FALSE
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          list(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, 1L, 1L, 1L, 1L, 1L), 19L, 
          FALSE
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          list(17L, 47L, 89L, 75L, 57L, 69L, 70L, 57L, 83L, 79L, 57L, 49L), 8L, 
          FALSE
      )))
  
  }
  
  main()
source_py: def possible_to_make_a_divisible_by_3_number_using_all_digits_in_an_array(arr, n):
      remainder = 0
      for i in range(0, n):
          remainder = ((remainder + arr[i]) % 3)
      return (remainder == 0)
source_cpp: bool possible_to_make_a_divisible_by_3_number_using_all_digits_in_an_array(vector<int> arr, int n) {
    int remainder = 0;
    for ( int i = 0;
    i < n;
    i ++ ) remainder = ( remainder + arr [ i ] ) % 3;
    return ( remainder == 0 );
  }