title: Sum Factors Number
signature: class Solution {
  
      public Integer sumFactorsNumber(Integer n) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(76, 140);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(21, 32);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(4, 7);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(49, 57);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(35, 48);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(55, 72);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(43, 44);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(39, 56);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(36, 91);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(5, 6);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
source_py: def sum_factors_number(n):
      result = 0
      for i in range(2, (int(math.sqrt(n)) + 1)):
          if ((n % i) == 0):
              if (i == (n / i)):
                  result = (result + i)
              else:
                  result = (result + (i + (n // i)))
      return ((result + n) + 1)
source_cpp: int sum_factors_number(int n) {
    int result = 0;
    for ( int i = 2;
    i <= sqrt ( n );
    i ++ ) {
      if ( n % i == 0 ) {
        if ( i == ( n / i ) ) result += i;
        else result += ( i + n / i );
      }
    }
    return ( result + n + 1 );
  }