title: K Th Digit Raised Power B
signature: function kThDigitRaisedPowerB(a: number, b: number, k: number): number {
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.entry_cls_name: Solution
question_info.test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return Math.abs(actual - expected) < 1e-09;
  }
  
  function driver(a: number, b: number, k: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(a, b, k),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(11, 2, 1, 1.0);
    console.log(`TEST-0...${result}`);
  
    result = driver(41, 3, 3, 9.210000000000036);
    console.log(`TEST-1...${result}`);
  
    result = driver(5, 4, 3, 6.25);
    console.log(`TEST-2...${result}`);
  
    result = driver(1, 2, 4, 0.001);
    console.log(`TEST-3...${result}`);
  
    result = driver(5, 2, 3, 0.25);
    console.log(`TEST-4...${result}`);
  
    result = driver(66, 5, 8, 5.233257599999973);
    console.log(`TEST-5...${result}`);
  
    result = driver(7, 10, 3, 2.489999999757856);
    console.log(`TEST-6...${result}`);
  
    result = driver(77, 30, 10, 4.0);
    console.log(`TEST-7...${result}`);
  
    result = driver(60, 50, 1, 0.0);
    console.log(`TEST-8...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: kThDigitRaisedPowerB
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js