title: Check Large Number Divisible 13 Not
signature: class Solution {
  
      public bool CheckLargeNumberDivisible13Not(string num) {
test_code: using System;
  using System.Numerics;
  using System.Diagnostics;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Security.Cryptography;
  using System.Web.UI;
  using System.Web.Script.Serialization;
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  namespace EvaluatePrediction {
      class TestRunner {
          public bool ValidateSolution(bool actual, bool expected){
              return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);
          }
  
          public string driver(string num, bool expected){
              try{
                PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();
                bool pred_result = solution_cls.PLACEHOLDER_FN_NAME(num); 
                if (ValidateSolution(
                      pred_result,
                      expected)){
                  return "PASSED";
                }
                return "FAILED";
              } 
              catch (Exception exception_obj)
              {
                return exception_obj.GetType().FullName;
              }
          }
          static void Main(string[] args) {
              TestRunner runner = new TestRunner();
              String result;
              result = runner.driver(
                  "vzTUaItpCpLnjY", 
                  false
              );
              Console.WriteLine(string.Format(
                  "TEST-0...{0}",
                  result)
              );result = runner.driver(
                  "33855", 
                  true
              );
              Console.WriteLine(string.Format(
                  "TEST-1...{0}",
                  result)
              );result = runner.driver(
                  "0011110101011", 
                  true
              );
              Console.WriteLine(string.Format(
                  "TEST-2...{0}",
                  result)
              );result = runner.driver(
                  "MMQ", 
                  false
              );
              Console.WriteLine(string.Format(
                  "TEST-3...{0}",
                  result)
              );result = runner.driver(
                  "439340517954", 
                  true
              );
              Console.WriteLine(string.Format(
                  "TEST-4...{0}",
                  result)
              );result = runner.driver(
                  "000000000", 
                  true
              );
              Console.WriteLine(string.Format(
                  "TEST-5...{0}",
                  result)
              );result = runner.driver(
                  "UugAuRRJbjEgl", 
                  true
              );
              Console.WriteLine(string.Format(
                  "TEST-6...{0}",
                  result)
              );result = runner.driver(
                  "6406553695441", 
                  true
              );
              Console.WriteLine(string.Format(
                  "TEST-7...{0}",
                  result)
              );result = runner.driver(
                  "011001", 
                  true
              );
              Console.WriteLine(string.Format(
                  "TEST-8...{0}",
                  result)
              );result = runner.driver(
                  "yjFqEEvgiNjEX", 
                  true
              );
              Console.WriteLine(string.Format(
                  "TEST-9...{0}",
                  result)
              );
          }
      }
  }
  
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 );
  }