title: Remainder 7 Large Numbers
signature: class Solution {
  
      public Integer remainder7LargeNumbers(String num) {
source_py: def remainder_7_large_numbers(num):
      series = [1, 3, 2, (- 1), (- 3), (- 2)]
      series_index = 0
      result = 0
      for i in range((len(num) - 1), (- 1), (- 1)):
          digit = (ord(num[i]) - 48)
          result += (digit * series[series_index])
          series_index = ((series_index + 1) % 6)
          result %= 7
      if (result < 0):
          result = ((result + 7) % 7)
      return result
source_cpp: int remainder_7_large_numbers(string num) {
    int series [ ] = {
      1, 3, 2, - 1, - 3, - 2 };
      int series_index = 0;
      int result = 0;
      for ( int i = num . size ( ) - 1;
      i >= 0;
      i -- ) {
        int digit = num [ i ] - '0';
        result += digit * series [ series_index ];
        series_index = ( series_index + 1 ) % 6;
        result %= 7;
      }
      if ( result < 0 ) result = ( result + 7 ) % 7;
      return result;
    }
question_info.extension: java
question_info.entry_fn_name: remainder7LargeNumbers
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 6, "inputs": {"num": "K"}}, {"idx": 1, "outputs": 3, "inputs": {"num": "850076"}}, {"idx": 2, "outputs": 6, "inputs": {"num": "00111"}}, {"idx": 3, "outputs": 5, "inputs": {"num": "X"}}, {"idx": 4, "outputs": 1, "inputs": {"num": "1"}}, {"idx": 5, "outputs": 1, "inputs": {"num": "10010001100"}}, {"idx": 6, "outputs": 0, "inputs": {"num": " pgPeLz"}}, {"idx": 7, "outputs": 3, "inputs": {"num": "53212456821275"}}, {"idx": 8, "outputs": 3, "inputs": {"num": "101"}}, {"idx": 9, "outputs": 3, "inputs": {"num": "V"}}]
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, Integer 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("K", 6);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution("850076", 3);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution("00111", 6);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution("X", 5);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution("1", 1);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution("10010001100", 1);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(" pgPeLz", 0);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution("53212456821275", 3);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution("101", 3);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution("V", 3);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(String num, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(num),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer 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__