title: K Th Digit Raised Power B
signature: func kThDigitRaisedPowerB(a int, b int, k int) float64 {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual float64, expected float64) bool {
      return math.Abs(actual - expected) < 1e-09
  }
  
  func driver(a int, b int, k int, expected float64) string {
      if validateSolution(PLACEHOLDER_FN_NAME(a, b, k),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(11, 
  	2, 
  	1, 1.0)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(41, 
  	3, 
  	3, 9.210000000000036)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(5, 
  	4, 
  	3, 6.25)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(1, 
  	2, 
  	4, 0.001)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(5, 
  	2, 
  	3, 0.25)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(66, 
  	5, 
  	8, 5.233257599999973)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(7, 
  	10, 
  	3, 2.489999999757856)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(77, 
  	30, 
  	10, 4.0)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(60, 
  	50, 
  	1, 0.0)
      fmt.Printf("TEST-8...%s\n", result)
      
          
  }
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;
  }