def sum_of_factors(num): # Sum of factors of num sum_factors = 0 for i in range(1, int(num**0.5) + 1): if num % i == 0: sum_factors += i if i != num // i: sum_factors += num // i return sum_factors def maxSubsetSum(arr): # Apply sum_of_factors to each element in arr return [sum_of_factors(num) for num in arr] # Example usage: arr = [12] # Example input from the image result = maxSubsetSum(arr) print(result) # Expected output: [28]