title: K Th Digit Raised Power B
signature: pub fn k_th_digit_raised_power_b(a: i32, b: i32, k: i32) -> f64 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: f64, expected: f64)->bool{
  return (actual - expected).abs() < 1e-09
  }
  pub fn driver(a: i32, b: i32, k: i32, expected: f64)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(a, b, k), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        11, 2, 1, 
        1.0
      ));
      
      println!("TEST-1...{}", driver(
        41, 3, 3, 
        9.210000000000036
      ));
      
      println!("TEST-2...{}", driver(
        5, 4, 3, 
        6.25
      ));
      
      println!("TEST-3...{}", driver(
        1, 2, 4, 
        0.001
      ));
      
      println!("TEST-4...{}", driver(
        5, 2, 3, 
        0.25
      ));
      
      println!("TEST-5...{}", driver(
        66, 5, 8, 
        5.233257599999973
      ));
      
      println!("TEST-6...{}", driver(
        7, 10, 3, 
        2.489999999757856
      ));
      
      println!("TEST-7...{}", driver(
        77, 30, 10, 
        4.0
      ));
      
      println!("TEST-8...{}", driver(
        60, 50, 1, 
        0.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;
  }