title: Check Large Number Divisible 13 Not
signature: class Solution {
  
      public Boolean checkLargeNumberDivisible13Not(String num) {
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.extension: java
question_info.entry_fn_name: checkLargeNumberDivisible13Not
question_info.entry_cls_name: Solution
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.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(String num, Boolean expected){
          try{
              Driver driver = new Driver();
              if (driver.run(num,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution("vzTUaItpCpLnjY", false);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution("33855", true);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution("0011110101011", true);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution("MMQ", false);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution("439340517954", true);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution("000000000", true);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution("UugAuRRJbjEgl", true);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution("6406553695441", true);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution("011001", true);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution("yjFqEEvgiNjEX", true);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(String num, Boolean expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(num),expected);
      }
      
      public boolean validateSolution(Boolean actual, Boolean expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__