title: Find Largest Prime Factor Number
signature: function findLargestPrimeFactorNumber(n: number): number {
source_py: def find_largest_prime_factor_number(n):
      maxPrime = (- 1)
      while ((n % 2) == 0):
          maxPrime = 2
          n >>= 1
      for i in range(3, (int(math.sqrt(n)) + 1), 2):
          while ((n % i) == 0):
              maxPrime = i
              n = (n / i)
      if (n > 2):
          maxPrime = n
      return int(maxPrime)
source_cpp: long long find_largest_prime_factor_number(long long n) {
    long long maxPrime = - 1;
    while ( n % 2 == 0 ) {
      maxPrime = 2;
      n >>= 1;
    }
    for ( int i = 3;
    i <= sqrt ( n );
    i += 2 ) {
      while ( n % i == 0 ) {
        maxPrime = i;
        n = n / i;
      }
    }
    if ( n > 2 ) maxPrime = n;
    return maxPrime;
  }
question_info.test_list: [{"idx": 0, "outputs": 7, "inputs": {"n": 98}}, {"idx": 1, "outputs": 2, "inputs": {"n": 8}}, {"idx": 2, "outputs": 13, "inputs": {"n": 78}}, {"idx": 3, "outputs": 13, "inputs": {"n": 65}}, {"idx": 4, "outputs": 11, "inputs": {"n": 55}}, {"idx": 5, "outputs": 5, "inputs": {"n": 10}}, {"idx": 6, "outputs": 5, "inputs": {"n": 10}}, {"idx": 7, "outputs": 37, "inputs": {"n": 37}}, {"idx": 8, "outputs": 13, "inputs": {"n": 39}}, {"idx": 9, "outputs": 5, "inputs": {"n": 15}}]
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(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(98, 7);
    console.log(`TEST-0...${result}`);
  
    result = driver(8, 2);
    console.log(`TEST-1...${result}`);
  
    result = driver(78, 13);
    console.log(`TEST-2...${result}`);
  
    result = driver(65, 13);
    console.log(`TEST-3...${result}`);
  
    result = driver(55, 11);
    console.log(`TEST-4...${result}`);
  
    result = driver(10, 5);
    console.log(`TEST-5...${result}`);
  
    result = driver(10, 5);
    console.log(`TEST-6...${result}`);
  
    result = driver(37, 37);
    console.log(`TEST-7...${result}`);
  
    result = driver(39, 13);
    console.log(`TEST-8...${result}`);
  
    result = driver(15, 5);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: findLargestPrimeFactorNumber
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