title: K Th Digit Raised Power B
signature: kThDigitRaisedPowerB(a, b, k) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(double actual, double expected){
      return (actual - expected).abs() < 1e-09;
  }
  
  String driver(a, b, k, double expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(a, b, k), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          11, 2, 1, 
          1.0)
      }");
  
      print("TEST-1...${driver(
          41, 3, 3, 
          9.210000000000036)
      }");
  
      print("TEST-2...${driver(
          5, 4, 3, 
          6.25)
      }");
  
      print("TEST-3...${driver(
          1, 2, 4, 
          0.001)
      }");
  
      print("TEST-4...${driver(
          5, 2, 3, 
          0.25)
      }");
  
      print("TEST-5...${driver(
          66, 5, 8, 
          5.233257599999973)
      }");
  
      print("TEST-6...${driver(
          7, 10, 3, 
          2.489999999757856)
      }");
  
      print("TEST-7...${driver(
          77, 30, 10, 
          4.0)
      }");
  
      print("TEST-8...${driver(
          60, 50, 1, 
          0.0)
      }");
  
      return 0;
  }
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;
  }