title: Possible To Make A Divisible By 3 Number Using All Digits In An Array
signature: pub fn possible_to_make_a_divisible_by_3_number_using_all_digits_in_an_array(arr: Vec<i32>, n: i32) -> bool {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: bool, expected: bool)->bool{
  return actual==expected
  }
  pub fn driver(arr: Vec<i32>, n: i32, expected: bool)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        Vec::from([2, 4, 9, 11, 12, 15, 16, 19, 21, 21, 23, 23, 24, 30, 31, 31, 32, 34, 37, 41, 41, 43, 45, 46, 47, 54, 58, 60, 62, 66, 66, 74, 74, 75, 75, 77, 77, 85, 89, 90, 92, 92, 93, 95, 98]), 30, 
        false
      ));
      
      println!("TEST-1...{}", driver(
        Vec::from([0, 66, 92, 24, -8, 88, -92, 86, 80, 82, 42, -20, -56, -2, -84, 32]), 14, 
        false
      ));
      
      println!("TEST-2...{}", driver(
        Vec::from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]), 29, 
        true
      ));
      
      println!("TEST-3...{}", driver(
        Vec::from([99, 83, 11, 99, 80, 76, 32, 12, 94, 66, 76]), 5, 
        true
      ));
      
      println!("TEST-4...{}", driver(
        Vec::from([-88, -84, -80, -80, -80, -80, -72, -68, -64, -62, -60, -52, -48, -44, -36, -24, -20, -18, -14, -8, -6, -6, -4, 6, 10, 14, 18, 24, 26, 26, 50, 50, 52, 60, 76, 90, 96, 98]), 19, 
        true
      ));
      
      println!("TEST-5...{}", driver(
        Vec::from([0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1]), 14, 
        false
      ));
      
      println!("TEST-6...{}", driver(
        Vec::from([6, 6, 8, 8, 10, 24, 24, 26, 27, 30, 34, 34, 36, 36, 39, 40, 41, 44, 45, 50, 52, 53, 57, 62, 64, 64, 70, 71, 72, 78, 78, 79, 80, 82, 89, 95, 96]), 28, 
        false
      ));
      
      println!("TEST-7...{}", driver(
        Vec::from([-28, -84, -14, -20, -14, -26, 28, -66, 48, 82, -46, -10, -94, 76, 56, -6, 72, -92, -32, 66, 50, -72, 64, 12, 48, 88, -36, -12, -6, -18, -36, -34, 44, 40, -54]), 25, 
        false
      ));
      
      println!("TEST-8...{}", driver(
        Vec::from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]), 19, 
        false
      ));
      
      println!("TEST-9...{}", driver(
        Vec::from([17, 47, 89, 75, 57, 69, 70, 57, 83, 79, 57, 49]), 8, 
        false
      ));
      
  }
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 );
  }