title: Number Is Divisible By 29 Or Not
signature: fun numberIsDivisibleBy29OrNot(n: Long): Boolean {
source_py: def number_is_divisible_by_29_or_not(n):
      while int((n / 100)):
          last_digit = int((n % 10))
          n = int((n / 10))
          n += (last_digit * 3)
      return ((n % 29) == 0)
source_cpp: bool number_is_divisible_by_29_or_not(long long int n) {
    while ( n / 100 ) {
      int last_digit = n % 10;
      n /= 10;
      n += last_digit * 3;
    }
    return ( n % 29 == 0 );
  }
question_info.test_list: [{"idx": 0, "outputs": true, "inputs": {"n": 29}}, {"idx": 1, "outputs": true, "inputs": {"n": 0}}, {"idx": 2, "outputs": false, "inputs": {"n": 65}}, {"idx": 3, "outputs": false, "inputs": {"n": 1419}}, {"idx": 4, "outputs": false, "inputs": {"n": 54}}, {"idx": 5, "outputs": false, "inputs": {"n": 7}}, {"idx": 6, "outputs": false, "inputs": {"n": 44}}, {"idx": 7, "outputs": false, "inputs": {"n": 34}}, {"idx": 8, "outputs": true, "inputs": {"n": 1160}}, {"idx": 9, "outputs": true, "inputs": {"n": 292929002929}}]
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:Boolean, expected:Boolean):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Long, expected:Boolean):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(29, true)
      println("TEST-0...${result}")
      
      result = driver(0, true)
      println("TEST-1...${result}")
      
      result = driver(65, false)
      println("TEST-2...${result}")
      
      result = driver(1419, false)
      println("TEST-3...${result}")
      
      result = driver(54, false)
      println("TEST-4...${result}")
      
      result = driver(7, false)
      println("TEST-5...${result}")
      
      result = driver(44, false)
      println("TEST-6...${result}")
      
      result = driver(34, false)
      println("TEST-7...${result}")
      
      result = driver(1160, true)
      println("TEST-8...${result}")
      
      result = driver(292929002929, true)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: numberIsDivisibleBy29OrNot
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