title: Divisibility By 7
signature: divisibilityBy7(num) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(bool actual, bool expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(num, bool expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          0, 
          true)
      }");
  
      print("TEST-1...${driver(
          -21, 
          false)
      }");
  
      print("TEST-2...${driver(
          7, 
          true)
      }");
  
      print("TEST-3...${driver(
          63, 
          false)
      }");
  
      print("TEST-4...${driver(
          84, 
          false)
      }");
  
      print("TEST-5...${driver(
          73, 
          false)
      }");
  
      print("TEST-6...${driver(
          81, 
          false)
      }");
  
      print("TEST-7...${driver(
          -10, 
          false)
      }");
  
      print("TEST-8...${driver(
          47, 
          false)
      }");
  
      print("TEST-9...${driver(
          23, 
          false)
      }");
  
      return 0;
  }
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 ) );
  }