title: Divisibility 9 Using Bitwise Operators
signature: function divisibility9UsingBitwiseOperators(n) {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value) {
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual, expected){
      return convertToString(actual)===convertToString(expected);
  }
  
  function driver(n, expected){
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(96, false);
    console.log(`TEST-0...${result}`);
  
    result = driver(85, false);
    console.log(`TEST-1...${result}`);
  
    result = driver(54, true);
    console.log(`TEST-2...${result}`);
  
    result = driver(14, false);
    console.log(`TEST-3...${result}`);
  
    result = driver(47, false);
    console.log(`TEST-4...${result}`);
  
    result = driver(11, false);
    console.log(`TEST-5...${result}`);
  
    result = driver(49, false);
    console.log(`TEST-6...${result}`);
  
    result = driver(99, true);
    console.log(`TEST-7...${result}`);
  
    result = driver(28, false);
    console.log(`TEST-8...${result}`);
  
    result = driver(82, false);
    console.log(`TEST-9...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    main();
  }
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 ) );
  }