title: K Th Digit Raised Power B
signature: class Solution {
  
      public Double kThDigitRaisedPowerB(Integer a, Integer b, Integer k) {
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.extension: java
question_info.entry_fn_name: kThDigitRaisedPowerB
question_info.entry_cls_name: Solution
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.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer a, Integer b, Integer k, Double expected){
          try{
              Driver driver = new Driver();
              if (driver.run(a, b, k,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(11, 2, 1, 1.0);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(41, 3, 3, 9.210000000000036);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(5, 4, 3, 6.25);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(1, 2, 4, 0.001);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(5, 2, 3, 0.25);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(66, 5, 8, 5.233257599999973);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(7, 10, 3, 2.489999999757856);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(77, 30, 10, 4.0);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(60, 50, 1, 0.0);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer a, Integer b, Integer k, Double expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(a, b, k),expected);
      }
      
      public boolean validateSolution(Double actual, Double expected){
          return Math.abs(actual - expected) < 1e-09;
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8
question_info.commands: java __FILENAME__