title: Divisibility By 7
signature: pub fn divisibility_by_7(num: 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(num: i32, expected: bool)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(num), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        0, 
        true
      ));
      
      println!("TEST-1...{}", driver(
        -21, 
        false
      ));
      
      println!("TEST-2...{}", driver(
        7, 
        true
      ));
      
      println!("TEST-3...{}", driver(
        63, 
        false
      ));
      
      println!("TEST-4...{}", driver(
        84, 
        false
      ));
      
      println!("TEST-5...{}", driver(
        73, 
        false
      ));
      
      println!("TEST-6...{}", driver(
        81, 
        false
      ));
      
      println!("TEST-7...{}", driver(
        -10, 
        false
      ));
      
      println!("TEST-8...{}", driver(
        47, 
        false
      ));
      
      println!("TEST-9...{}", driver(
        23, 
        false
      ));
      
  }
source_py: def divisibility_by_7(num):
      if (num < 0):
          return divisibility_by_7((- num))
      if ((num == 0) or (num == 7)):
          return True
      if (num < 10):
          return False
      return divisibility_by_7(((num / 10) - (2 * (num - ((num / 10) * 10)))))
source_cpp: int divisibility_by_7(int num) {
    if ( num < 0 ) return divisibility_by_7 ( - num );
    if ( num == 0 || num == 7 ) return 1;
    if ( num < 10 ) return 0;
    return divisibility_by_7 ( num / 10 - 2 * ( num - num / 10 * 10 ) );
  }