Skip to content

Commit a7081f9

Browse files
authored
Change code not making big list
1 parent 38d7a5a commit a7081f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

programmers/Lv.1/count_divisor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
def solution(left, right):
2-
int_list = [0] * 1000
2+
int_list = [0] * (right - left + 1)
33
for i in range(1, right + 1):
44
for j in range(left, right + 1):
55
if j >= i and j % i == 0:
6-
int_list[j] += 1
6+
int_list[j - left] += 1
77
# print(int_list[left : right + 1])
88
answer = 0
99
for i in range(left, right + 1):
10-
if int_list[i] % 2 == 0:
10+
if int_list[i - left] % 2 == 0:
1111
answer += i
1212
else:
1313
answer -= i

0 commit comments

Comments
 (0)