title: Divisibility 9 Using Bitwise Operators
signature: fun divisibility9UsingBitwiseOperators(n: Int): Boolean {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Boolean, expected:Boolean):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, expected:Boolean):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(96, false)
      println("TEST-0...${result}")
      
      result = driver(85, false)
      println("TEST-1...${result}")
      
      result = driver(54, true)
      println("TEST-2...${result}")
      
      result = driver(14, false)
      println("TEST-3...${result}")
      
      result = driver(47, false)
      println("TEST-4...${result}")
      
      result = driver(11, false)
      println("TEST-5...${result}")
      
      result = driver(49, false)
      println("TEST-6...${result}")
      
      result = driver(99, true)
      println("TEST-7...${result}")
      
      result = driver(28, false)
      println("TEST-8...${result}")
      
      result = driver(82, false)
      println("TEST-9...${result}")
      
          
  }
  
  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 ) );
  }