title: Check If A Number Is Power Of Another Number
signature: pub fn check_if_a_number_is_power_of_another_number(x: i32, y: i32) -> bool {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: bool, expected: bool)->bool{
  return actual==expected
  }
  pub fn driver(x: i32, y: i32, expected: bool)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(x, y), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        57, 1, 
        true
      ));
      
      println!("TEST-1...{}", driver(
        3, 9, 
        true
      ));
      
      println!("TEST-2...{}", driver(
        10, 101, 
        false
      ));
      
      println!("TEST-3...{}", driver(
        10, 10000, 
        true
      ));
      
      println!("TEST-4...{}", driver(
        6, 46656, 
        true
      ));
      
      println!("TEST-5...{}", driver(
        2, 2048, 
        true
      ));
      
      println!("TEST-6...{}", driver(
        1, 40, 
        false
      ));
      
      println!("TEST-7...{}", driver(
        20, 79, 
        false
      ));
      
      println!("TEST-8...{}", driver(
        96, 98, 
        false
      ));
      
      println!("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 );
  }