title: Check Large Number Divisible 13 Not
signature: fun checkLargeNumberDivisible13Not(num: String): Boolean {
source_py: def check_large_number_divisible_13_not(num):
      length = len(num)
      if ((length == 1) and (num[0] == '0')):
          return True
      if ((length % 3) == 1):
          num = (str(num) + '00')
          length += 2
      elif ((length % 3) == 2):
          num = (str(num) + '0')
          length += 1
      sum = 0
      p = 1
      for i in range((length - 1), (- 1), (- 1)):
          group = 0
          group += (ord(num[i]) - ord('0'))
          i -= 1
          group += ((ord(num[i]) - ord('0')) * 10)
          i -= 1
          group += ((ord(num[i]) - ord('0')) * 100)
          sum = (sum + (group * p))
          p *= (- 1)
      sum = abs(sum)
      return ((sum % 13) == 0)
source_cpp: bool check_large_number_divisible_13_not(string num) {
    int length = num . size ( );
    if ( length == 1 && num [ 0 ] == '0' ) return true;
    if ( length % 3 == 1 ) {
      num += "00";
      length += 2;
    }
    else if ( length % 3 == 2 ) {
      num += "0";
      length += 1;
    }
    int sum = 0, p = 1;
    for ( int i = length - 1;
    i >= 0;
    i -- ) {
      int group = 0;
      group += num [ i -- ] - '0';
      group += ( num [ i -- ] - '0' ) * 10;
      group += ( num [ i ] - '0' ) * 100;
      sum = sum + group * p;
      p *= ( - 1 );
    }
    sum = abs ( sum );
    return ( sum % 13 == 0 );
  }
question_info.test_list: [{"idx": 0, "outputs": false, "inputs": {"num": "vzTUaItpCpLnjY"}}, {"idx": 1, "outputs": true, "inputs": {"num": "33855"}}, {"idx": 2, "outputs": true, "inputs": {"num": "0011110101011"}}, {"idx": 3, "outputs": false, "inputs": {"num": "MMQ"}}, {"idx": 4, "outputs": true, "inputs": {"num": "439340517954"}}, {"idx": 5, "outputs": true, "inputs": {"num": "000000000"}}, {"idx": 6, "outputs": true, "inputs": {"num": "UugAuRRJbjEgl"}}, {"idx": 7, "outputs": true, "inputs": {"num": "6406553695441"}}, {"idx": 8, "outputs": true, "inputs": {"num": "011001"}}, {"idx": 9, "outputs": true, "inputs": {"num": "yjFqEEvgiNjEX"}}]
question_info.extension: kts
question_info.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: String, 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("vzTUaItpCpLnjY", false)
      println("TEST-0...${result}")
      
      result = driver("33855", true)
      println("TEST-1...${result}")
      
      result = driver("0011110101011", true)
      println("TEST-2...${result}")
      
      result = driver("MMQ", false)
      println("TEST-3...${result}")
      
      result = driver("439340517954", true)
      println("TEST-4...${result}")
      
      result = driver("000000000", true)
      println("TEST-5...${result}")
      
      result = driver("UugAuRRJbjEgl", true)
      println("TEST-6...${result}")
      
      result = driver("6406553695441", true)
      println("TEST-7...${result}")
      
      result = driver("011001", true)
      println("TEST-8...${result}")
      
      result = driver("yjFqEEvgiNjEX", true)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: checkLargeNumberDivisible13Not
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn