title: K Th Digit Raised Power B
signature: kThDigitRaisedPowerB :: Integer -> Integer -> Integer -> Double
  kThDigitRaisedPowerB a b k = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Double -> Double -> Bool
  validateSolution actual expected = do
      (abs (actual-expected)) < 1e-09
  
  driver :: Integer -> Integer -> Integer -> Double -> String
  driver a b k expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME a b k) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (11) (2) (1) (1.0) )
  
      printf "TEST-1...%s\n" (driver (41) (3) (3) (9.210000000000036) )
  
      printf "TEST-2...%s\n" (driver (5) (4) (3) (6.25) )
  
      printf "TEST-3...%s\n" (driver (1) (2) (4) (0.001) )
  
      printf "TEST-4...%s\n" (driver (5) (2) (3) (0.25) )
  
      printf "TEST-5...%s\n" (driver (66) (5) (8) (5.233257599999973) )
  
      printf "TEST-6...%s\n" (driver (7) (10) (3) (2.489999999757856) )
  
      printf "TEST-7...%s\n" (driver (77) (30) (10) (4.0) )
  
      printf "TEST-8...%s\n" (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;
  }