Skip to content

Commit 4e336e6

Browse files
authored
Move the import command into backtrack()
1 parent bb9ec4a commit 4e336e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backtracking/power_sum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
The only solution is 2^2+3^2. Constraints: 1<=X<=1000, 2<=N<=10.
77
"""
88

9-
from math import pow
10-
119

1210
def backtrack(
1311
needed_sum: int,
@@ -32,6 +30,8 @@ def backtrack(
3230
>>> backtrack(50, 1, 1, 0, 0)
3331
(0, 3658)
3432
"""
33+
from math import pow
34+
3535
if current_sum == needed_sum:
3636
# If the sum of the powers is equal to needed_sum, then we have a solution.
3737
solutions_count += 1

0 commit comments

Comments
 (0)