title: Divisibility 9 Using Bitwise Operators
signature: pub fn divisibility_9_using_bitwise_operators(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(n: i32, expected: bool)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        96, 
        false
      ));
      
      println!("TEST-1...{}", driver(
        85, 
        false
      ));
      
      println!("TEST-2...{}", driver(
        54, 
        true
      ));
      
      println!("TEST-3...{}", driver(
        14, 
        false
      ));
      
      println!("TEST-4...{}", driver(
        47, 
        false
      ));
      
      println!("TEST-5...{}", driver(
        11, 
        false
      ));
      
      println!("TEST-6...{}", driver(
        49, 
        false
      ));
      
      println!("TEST-7...{}", driver(
        99, 
        true
      ));
      
      println!("TEST-8...{}", driver(
        28, 
        false
      ));
      
      println!("TEST-9...{}", driver(
        82, 
        false
      ));
      
  }
source_py: def divisibility_9_using_bitwise_operators(n):
      if ((n == 0) or (n == 9)):
          return True
      if (n < 9):
          return False
      return divisibility_9_using_bitwise_operators((int((n >> 3)) - int((n & 7))))
source_cpp: bool divisibility_9_using_bitwise_operators(int n) {
    if ( n == 0 || n == 9 ) return true;
    if ( n < 9 ) return false;
    return divisibility_9_using_bitwise_operators ( ( int ) ( n >> 3 ) - ( int ) ( n & 7 ) );
  }