title: K Th Digit Raised Power B
signature: fun kThDigitRaisedPowerB(a: Int, b: Int, k: Int): Double {
source_py: def k_th_digit_raised_power_b(a, b, k):
      p = (a ** b)
      count = 0
      while ((p > 0) and (count < k)):
          rem = (p % 10)
          count = (count + 1)
          if (count == k):
              return rem
          p = (p / 10)
source_cpp: int k_th_digit_raised_power_b(int a, int b, int k) {
    int p = pow ( a, b );
    int count = 0;
    while ( p > 0 && count < k ) {
      int rem = p % 10;
      count ++;
      if ( count == k ) return rem;
      p = p / 10;
    }
    return 0;
  }
question_info.test_list: [{"idx": 0, "outputs": 1, "inputs": {"a": 11, "b": 2, "k": 1}}, {"idx": 1, "outputs": 9.210000000000036, "inputs": {"a": 41, "b": 3, "k": 3}}, {"idx": 2, "outputs": 6.25, "inputs": {"a": 5, "b": 4, "k": 3}}, {"idx": 3, "outputs": 0.001, "inputs": {"a": 1, "b": 2, "k": 4}}, {"idx": 4, "outputs": 0.25, "inputs": {"a": 5, "b": 2, "k": 3}}, {"idx": 5, "outputs": 5.233257599999973, "inputs": {"a": 66, "b": 5, "k": 8}}, {"idx": 6, "outputs": 2.489999999757856, "inputs": {"a": 7, "b": 10, "k": 3}}, {"idx": 7, "outputs": 4.0, "inputs": {"a": 77, "b": 30, "k": 10}}, {"idx": 8, "outputs": 0, "inputs": {"a": 60, "b": 50, "k": 1}}]
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:Double, expected:Double):Boolean{
    return abs(actual - expected) < 1e-09
  }
  fun driver(a: Int, b: Int, k: Int, expected:Double):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(a, b, k), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(11, 2, 1, 1.0)
      println("TEST-0...${result}")
      
      result = driver(41, 3, 3, 9.210000000000036)
      println("TEST-1...${result}")
      
      result = driver(5, 4, 3, 6.25)
      println("TEST-2...${result}")
      
      result = driver(1, 2, 4, 0.001)
      println("TEST-3...${result}")
      
      result = driver(5, 2, 3, 0.25)
      println("TEST-4...${result}")
      
      result = driver(66, 5, 8, 5.233257599999973)
      println("TEST-5...${result}")
      
      result = driver(7, 10, 3, 2.489999999757856)
      println("TEST-6...${result}")
      
      result = driver(77, 30, 10, 4.0)
      println("TEST-7...${result}")
      
      result = driver(60, 50, 1, 0.0)
      println("TEST-8...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: kThDigitRaisedPowerB
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn