title: Find Largest Prime Factor Number
signature: function find_largest_prime_factor_number(n)
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.entry_fn_name: find_largest_prime_factor_number
question_info.entry_cls_name: Solution
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
question_info.test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(n, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(n) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(98, 7)
      print(string.format("TEST-0...%s",result))
  
      result = driver(8, 2)
      print(string.format("TEST-1...%s",result))
  
      result = driver(78, 13)
      print(string.format("TEST-2...%s",result))
  
      result = driver(65, 13)
      print(string.format("TEST-3...%s",result))
  
      result = driver(55, 11)
      print(string.format("TEST-4...%s",result))
  
      result = driver(10, 5)
      print(string.format("TEST-5...%s",result))
  
      result = driver(10, 5)
      print(string.format("TEST-6...%s",result))
  
      result = driver(37, 37)
      print(string.format("TEST-7...%s",result))
  
      result = driver(39, 13)
      print(string.format("TEST-8...%s",result))
  
      result = driver(15, 5)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
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}}]