Skip to content

Commit f0dec58

Browse files
committed
Solve: 문제 18 두개의 수로 특정 값 만들기
1 parent 4226a0a commit f0dec58

File tree

1 file changed

+21
-0
lines changed
  • seung365/programmers

1 file changed

+21
-0
lines changed

seung365/programmers/18.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
def hash (arr, target):
2+
3+
dic = {}
4+
5+
for i in arr:
6+
if i > target:
7+
dic[i] = 0
8+
else:
9+
dic[i] = 1
10+
11+
for key in dic:
12+
if key in dic:
13+
if not target-key == key:
14+
if target-key in dic:
15+
print(True)
16+
return
17+
18+
print(False)
19+
20+
hash([1,2,3,4,8], 6)
21+
hash([2,3,5,9], 10)

0 commit comments

Comments
 (0)