Ad
Code
Diff
  • import itertools
    
    def divisors(n): 
        return sorted(list(itertools.chain.from_iterable([[i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0])))
        
    • def divisors(n):
    • return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
    • import itertools
    • def divisors(n):
    • return sorted(list(itertools.chain.from_iterable([[i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0])))