title: Finding Power Prime Number P N
signature: function findingPowerPrimeNumberPN(n: number, p: number): number {
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(n: number, p: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n, p),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(49, 30, 1.6333333333333333);
    console.log(`TEST-0...${result}`);
  
    result = driver(80, 25, 3.2);
    console.log(`TEST-1...${result}`);
  
    result = driver(10, 9, 1.1111111111111112);
    console.log(`TEST-2...${result}`);
  
    result = driver(81, 57, 1.4210526315789473);
    console.log(`TEST-3...${result}`);
  
    result = driver(11, 4, 2.75);
    console.log(`TEST-4...${result}`);
  
    result = driver(45, 34, 1.3235294117647058);
    console.log(`TEST-5...${result}`);
  
    result = driver(86, 90, 0.0);
    console.log(`TEST-6...${result}`);
  
    result = driver(27, 78, 0.0);
    console.log(`TEST-7...${result}`);
  
    result = driver(80, 60, 1.3333333333333333);
    console.log(`TEST-8...${result}`);
  
    result = driver(97, 31, 3.129032258064516);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def finding_power_prime_number_p_n(n, p):
      ans = 0
      temp = p
      while (temp <= n):
          ans += (n / temp)
          temp = (temp * p)
      return ans
source_cpp: int finding_power_prime_number_p_n(int n, int p) {
    int ans = 0;
    int temp = p;
    while ( temp <= n ) {
      ans += n / temp;
      temp = temp * p;
    }
    return ans;
  }