title: Remainder 7 Large Numbers
signature: fun remainder7LargeNumbers(num: String): Int {
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.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.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(num: String, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver("K", 6)
      println("TEST-0...${result}")
      
      result = driver("850076", 3)
      println("TEST-1...${result}")
      
      result = driver("00111", 6)
      println("TEST-2...${result}")
      
      result = driver("X", 5)
      println("TEST-3...${result}")
      
      result = driver("1", 1)
      println("TEST-4...${result}")
      
      result = driver("10010001100", 1)
      println("TEST-5...${result}")
      
      result = driver(" pgPeLz", 0)
      println("TEST-6...${result}")
      
      result = driver("53212456821275", 3)
      println("TEST-7...${result}")
      
      result = driver("101", 3)
      println("TEST-8...${result}")
      
      result = driver("V", 3)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: remainder7LargeNumbers
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn