input: Write a python function to find the highest perfect number less than or equal to a given number.
  assert computeHighestPerfectNumber(1000) == 496
  assert computeHighestPerfectNumber(500) == 496
  assert computeHighestPerfectNumber(10) == 6
  assert computeHighestPerfectNumber(5) == -1
  assert computeHighestPerfectNumber(28) == 28
output: def computeHighestPerfectNumber(n):
      def is_perfect(num):
          if num < 2:
              return False
          sum_of_divisors = 1
          for i in range(2, int(num**0.5) + 1):
              if num % i == 0:
                  sum_of_divisors += i
                  if i != num // i:
                      sum_of_divisors += num // i
          return sum_of_divisors == num
  
      highest_perfect = -1
      for i in range(1, n + 1):
          if is_perfect(i):
              highest_perfect = i
  
      return highest_perfect