title: Finding Power Prime Number P N 1
signature: findingPowerPrimeNumberPN1(n, p) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(n, p, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n, p), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          76, 43, 
          1)
      }");
  
      print("TEST-1...${driver(
          77, 91, 
          0)
      }");
  
      print("TEST-2...${driver(
          9, 42, 
          0)
      }");
  
      print("TEST-3...${driver(
          59, 67, 
          0)
      }");
  
      print("TEST-4...${driver(
          8, 52, 
          0)
      }");
  
      print("TEST-5...${driver(
          97, 8, 
          13)
      }");
  
      print("TEST-6...${driver(
          78, 24, 
          3)
      }");
  
      print("TEST-7...${driver(
          41, 88, 
          0)
      }");
  
      print("TEST-8...${driver(
          72, 61, 
          1)
      }");
  
      print("TEST-9...${driver(
          71, 28, 
          2)
      }");
  
      return 0;
  }
source_py: def finding_power_prime_number_p_n_1(n, p):
      ans = 0
      temp = p
      while (temp <= n):
          ans += (n / temp)
          temp = (temp * p)
      return int(ans)
source_cpp: int finding_power_prime_number_p_n_1(int n, int p) {
    int ans = 0;
    int temp = p;
    while ( temp <= n ) {
      ans += n / temp;
      temp = temp * p;
    }
    return ans;
  }