Se încarcă problema…
Divisors show which numbers can divide n without a remainder. The function divisors receives an integer n and returns a list of all its positive divisors. The result should be sorted in ascending order.
6[1, 2, 3, 6]1[1]12[1, 2, 3, 4, 6, 12]def divisors(n: int) -> list[int]:
Conectează-te pentru a vedea istoricul soluțiilor trimise
Conectează-teConectează-te pentru a folosi Mentorul AI
Conectează-te6[1,2,3,6]1[1]12[1,2,3,4,6,12]7[1,7]9[1,3,9]10[1,2,5,10]