title: Find Minimum Number Divided Make Number Perfect Square
signature: function findMinimumNumberDividedMakeNumberPerfectSquare(n: number): number {
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(n: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(95, 95);
    console.log(`TEST-0...${result}`);
  
    result = driver(48, 3);
    console.log(`TEST-1...${result}`);
  
    result = driver(3, 3);
    console.log(`TEST-2...${result}`);
  
    result = driver(10, 10);
    console.log(`TEST-3...${result}`);
  
    result = driver(82, 82);
    console.log(`TEST-4...${result}`);
  
    result = driver(1, 1);
    console.log(`TEST-5...${result}`);
  
    result = driver(77, 77);
    console.log(`TEST-6...${result}`);
  
    result = driver(99, 11);
    console.log(`TEST-7...${result}`);
  
    result = driver(23, 23);
    console.log(`TEST-8...${result}`);
  
    result = driver(61, 61);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def find_minimum_number_divided_make_number_perfect_square(n):
      count = 0
      ans = 1
      while ((n % 2) == 0):
          count += 1
          n //= 2
      if ((count % 2) is not 0):
          ans *= 2
      for i in range(3, (int(math.sqrt(n)) + 1), 2):
          count = 0
          while ((n % i) == 0):
              count += 1
              n //= i
          if ((count % 2) is not 0):
              ans *= i
      if (n > 2):
          ans *= n
      return ans
source_cpp: int find_minimum_number_divided_make_number_perfect_square(int n) {
    int count = 0, ans = 1;
    while ( n % 2 == 0 ) {
      count ++;
      n /= 2;
    }
    if ( count % 2 ) ans *= 2;
    for ( int i = 3;
    i <= sqrt ( n );
    i += 2 ) {
      count = 0;
      while ( n % i == 0 ) {
        count ++;
        n /= i;
      }
      if ( count % 2 ) ans *= i;
    }
    if ( n > 2 ) ans *= n;
    return ans;
  }