title: Find Largest Prime Factor Number
signature: func findLargestPrimeFactorNumber(n int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(n int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(98, 7)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(8, 2)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(78, 13)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(65, 13)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(55, 11)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(10, 5)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(10, 5)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(37, 37)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(39, 13)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(15, 5)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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;
  }