title: Remainder 7 Large Numbers
signature: pub fn remainder_7_large_numbers(num: String) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(num: String, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(num), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        "K".to_string(), 
        6
      ));
      
      println!("TEST-1...{}", driver(
        "850076".to_string(), 
        3
      ));
      
      println!("TEST-2...{}", driver(
        "00111".to_string(), 
        6
      ));
      
      println!("TEST-3...{}", driver(
        "X".to_string(), 
        5
      ));
      
      println!("TEST-4...{}", driver(
        "1".to_string(), 
        1
      ));
      
      println!("TEST-5...{}", driver(
        "10010001100".to_string(), 
        1
      ));
      
      println!("TEST-6...{}", driver(
        " pgPeLz".to_string(), 
        0
      ));
      
      println!("TEST-7...{}", driver(
        "53212456821275".to_string(), 
        3
      ));
      
      println!("TEST-8...{}", driver(
        "101".to_string(), 
        3
      ));
      
      println!("TEST-9...{}", driver(
        "V".to_string(), 
        3
      ));
      
  }
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;
    }