title: Check If A Number Is Power Of Another Number 1
signature: function checkIfANumberIsPowerOfAnotherNumber1(x: number, y: number): number {
source_py: def check_if_a_number_is_power_of_another_number_1(x, y):
      res1 = (math.log(y) / math.log(x))
      res2 = (math.log(y) / math.log(x))
      return (1 if (res1 == res2) else 0)
source_cpp: bool check_if_a_number_is_power_of_another_number_1(int x, int y) {
    int res1 = log ( y ) / log ( x );
    double res2 = log ( y ) / log ( x );
    return ( res1 == res2 );
  }
question_info.test_list: [{"idx": 0, "outputs": 1, "inputs": {"x": 57, "y": 1}}, {"idx": 1, "outputs": 1, "inputs": {"x": 3, "y": 9}}, {"idx": 2, "outputs": 1, "inputs": {"x": 10, "y": 101}}, {"idx": 3, "outputs": 1, "inputs": {"x": 10, "y": 10000}}, {"idx": 4, "outputs": 1, "inputs": {"x": 6, "y": 46656}}, {"idx": 5, "outputs": 1, "inputs": {"x": 2, "y": 2048}}, {"idx": 6, "outputs": 1, "inputs": {"x": 2, "y": 40}}, {"idx": 7, "outputs": 1, "inputs": {"x": 20, "y": 79}}, {"idx": 8, "outputs": 1, "inputs": {"x": 96, "y": 98}}, {"idx": 9, "outputs": 1, "inputs": {"x": 25, "y": 5}}]
question_info.entry_cls_name: Solution
question_info.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 convertToString(actual) === convertToString(expected);
  }
  
  function driver(x: number, y: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(x, y),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(57, 1, 1);
    console.log(`TEST-0...${result}`);
  
    result = driver(3, 9, 1);
    console.log(`TEST-1...${result}`);
  
    result = driver(10, 101, 1);
    console.log(`TEST-2...${result}`);
  
    result = driver(10, 10000, 1);
    console.log(`TEST-3...${result}`);
  
    result = driver(6, 46656, 1);
    console.log(`TEST-4...${result}`);
  
    result = driver(2, 2048, 1);
    console.log(`TEST-5...${result}`);
  
    result = driver(2, 40, 1);
    console.log(`TEST-6...${result}`);
  
    result = driver(20, 79, 1);
    console.log(`TEST-7...${result}`);
  
    result = driver(96, 98, 1);
    console.log(`TEST-8...${result}`);
  
    result = driver(25, 5, 1);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: checkIfANumberIsPowerOfAnotherNumber1
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js