title: Check If A Number Is Power Of Another Number
signature: fun checkIfANumberIsPowerOfAnotherNumber(x: Int, y: Int): Boolean {
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 );
  }
question_info.test_list: [{"idx": 0, "outputs": true, "inputs": {"x": 57, "y": 1}}, {"idx": 1, "outputs": true, "inputs": {"x": 3, "y": 9}}, {"idx": 2, "outputs": false, "inputs": {"x": 10, "y": 101}}, {"idx": 3, "outputs": true, "inputs": {"x": 10, "y": 10000}}, {"idx": 4, "outputs": true, "inputs": {"x": 6, "y": 46656}}, {"idx": 5, "outputs": true, "inputs": {"x": 2, "y": 2048}}, {"idx": 6, "outputs": false, "inputs": {"x": 1, "y": 40}}, {"idx": 7, "outputs": false, "inputs": {"x": 20, "y": 79}}, {"idx": 8, "outputs": false, "inputs": {"x": 96, "y": 98}}, {"idx": 9, "outputs": false, "inputs": {"x": 25, "y": 5}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Boolean, expected:Boolean):Boolean{
    return actual.equals(expected)
  }
  fun driver(x: Int, y: Int, expected:Boolean):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(x, y), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(57, 1, true)
      println("TEST-0...${result}")
      
      result = driver(3, 9, true)
      println("TEST-1...${result}")
      
      result = driver(10, 101, false)
      println("TEST-2...${result}")
      
      result = driver(10, 10000, true)
      println("TEST-3...${result}")
      
      result = driver(6, 46656, true)
      println("TEST-4...${result}")
      
      result = driver(2, 2048, true)
      println("TEST-5...${result}")
      
      result = driver(1, 40, false)
      println("TEST-6...${result}")
      
      result = driver(20, 79, false)
      println("TEST-7...${result}")
      
      result = driver(96, 98, false)
      println("TEST-8...${result}")
      
      result = driver(25, 5, false)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: checkIfANumberIsPowerOfAnotherNumber
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn