title: Check Large Number Divisible 13 Not
signature: bool checkLargeNumberDivisible13Not(string num) {
test_code: #include <algorithm>
  #include <assert.h>
  #include <cstdlib>
  #include <iostream>
  #include <map>
  #include <set>
  #include <string>
  #include <tuple> 
  #include <unordered_map>
  #include <vector>
  #include <math.h>
  #include <cmath>
  #include <bits/stdc++.h>
  #include <numeric>
  #include <functional>
  
  using namespace std;
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(bool actual, bool expected){
      return actual == expected;
  }
  
  string driver(string num, bool expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)){
              return "PASSED";
          }
          return "FAILED";
      }
      catch (const std::overflow_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::runtime_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::exception& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (...)
      {
          return "UNK_ERROR";
      }
  }
  
  int main() {
      string result = "";
  
      result = driver("vzTUaItpCpLnjY", false); 
      cout << "TEST-" << 0 << "..."
           <<  result
           << "\n";
  
      result = driver("33855", true); 
      cout << "TEST-" << 1 << "..."
           <<  result
           << "\n";
  
      result = driver("0011110101011", true); 
      cout << "TEST-" << 2 << "..."
           <<  result
           << "\n";
  
      result = driver("MMQ", false); 
      cout << "TEST-" << 3 << "..."
           <<  result
           << "\n";
  
      result = driver("439340517954", true); 
      cout << "TEST-" << 4 << "..."
           <<  result
           << "\n";
  
      result = driver("000000000", true); 
      cout << "TEST-" << 5 << "..."
           <<  result
           << "\n";
  
      result = driver("UugAuRRJbjEgl", true); 
      cout << "TEST-" << 6 << "..."
           <<  result
           << "\n";
  
      result = driver("6406553695441", true); 
      cout << "TEST-" << 7 << "..."
           <<  result
           << "\n";
  
      result = driver("011001", true); 
      cout << "TEST-" << 8 << "..."
           <<  result
           << "\n";
  
      result = driver("yjFqEEvgiNjEX", true); 
      cout << "TEST-" << 9 << "..."
           <<  result
           << "\n";
  
      return 0;
  }
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 );
  }