We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f05381 commit c955567Copy full SHA for c955567
1276-closest-divisors/closest-divisors.py
@@ -0,0 +1,7 @@
1
+class Solution:
2
+ def closestDivisors(self, num: int) -> List[int]:
3
+ for i in reversed(range(1, int((num + 2) ** 0.5) + 1)):
4
+ if not (num + 1) % i:
5
+ return [i, (num + 1) // i]
6
+ if not (num + 2) % i:
7
+ return [i, (num + 2) // i]
0 commit comments