title: Divisibility By 7
signature: fun divisibilityBy7(num: 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(num: Int, expected:Boolean):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(0, true)
      println("TEST-0...${result}")
      
      result = driver(-21, false)
      println("TEST-1...${result}")
      
      result = driver(7, true)
      println("TEST-2...${result}")
      
      result = driver(63, false)
      println("TEST-3...${result}")
      
      result = driver(84, false)
      println("TEST-4...${result}")
      
      result = driver(73, false)
      println("TEST-5...${result}")
      
      result = driver(81, false)
      println("TEST-6...${result}")
      
      result = driver(-10, false)
      println("TEST-7...${result}")
      
      result = driver(47, false)
      println("TEST-8...${result}")
      
      result = driver(23, false)
      println("TEST-9...${result}")
      
          
  }
  
  main()
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 ) );
  }