We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8b1cc4 commit 97c2794Copy full SHA for 97c2794
programmers/Lv.1/count_divisor.py
@@ -0,0 +1,14 @@
1
+def solution(left, right):
2
+ int_list = [0] * 1000
3
+ for i in range(1, right + 1):
4
+ for j in range(left, right + 1):
5
+ if j >= i and j % i == 0:
6
+ int_list[j] += 1
7
+ # print(int_list[left : right + 1])
8
+ answer = 0
9
+ for i in range(left, right + 1):
10
+ if int_list[i] % 2 == 0:
11
+ answer += i
12
+ else:
13
+ answer -= i
14
+ return answer
0 commit comments