title: Check If A Number Is Power Of Another Number
signature: def checkIfANumberIsPowerOfAnotherNumber(x: Int, y: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Boolean , expected: Boolean): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(x: Int, y: Int, expected: Boolean): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(x, y),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        57, 1, 
        true    
      )}")   
  
  
      println(s"TEST-1...${driver(
        3, 9, 
        true    
      )}")   
  
  
      println(s"TEST-2...${driver(
        10, 101, 
        false    
      )}")   
  
  
      println(s"TEST-3...${driver(
        10, 10000, 
        true    
      )}")   
  
  
      println(s"TEST-4...${driver(
        6, 46656, 
        true    
      )}")   
  
  
      println(s"TEST-5...${driver(
        2, 2048, 
        true    
      )}")   
  
  
      println(s"TEST-6...${driver(
        1, 40, 
        false    
      )}")   
  
  
      println(s"TEST-7...${driver(
        20, 79, 
        false    
      )}")   
  
  
      println(s"TEST-8...${driver(
        96, 98, 
        false    
      )}")   
  
  
      println(s"TEST-9...${driver(
        25, 5, 
        false    
      )}")   
  
  }
  
source_py: def check_if_a_number_is_power_of_another_number(x, y):
      if (x == 1):
          return (y == 1)
      pow = 1
      while (pow < y):
          pow = (pow * x)
      return (pow == y)
source_cpp: bool check_if_a_number_is_power_of_another_number(int x, long int y) {
    if ( x == 1 ) return ( y == 1 );
    long int pow = 1;
    while ( pow < y ) pow *= x;
    return ( pow == y );
  }