๋ฐ์ํ
Notice
Recent Posts
Recent Comments
Link
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- MacOS
- np.zeros_like
- sql
- jdbc
- ์๋ฐ
- ์ ํ ํฌ ํ์ด์ฌ
- dacon
- ์ง ๊ฐ ์์ธก ๋ถ์
- ์ด์ง์ ๋ณํ
- ์ด๊ฒ์ด ์ทจ์ ์ ์ํ ์ฝ๋ฉํ ์คํธ๋ค
- ํฉํ ๋ฆฌ์ผ ์ง๋ฒ
- Do it
- ์ต์
- ๋ธ๋ผ์ฐ์ ์คํ
- ํ๋ก๊ทธ๋๋จธ์ค
- PYTHON
- matplotlib
- java
- ์ฐธ์กฐ ๋ณ์
- DFS
- ๋ฐฑ์ค
- mysql
- 2BPerfect
- BFS
- Do_it
- ์์ด
- ๋ฐ์ค๊ทธ๋ํ
- ํ์ ๋ณ์
- Extended Slices
- ๋ค์ต์คํธ๋ผ ์๊ณ ๋ฆฌ์ฆ
Archives
- Today
- Total
๐ฆ ๊ณต๋ฃก์ด ๋์!
[ํ๋ก๊ทธ๋๋จธ์ค] Python ์์ฃผํ์ง ๋ชปํ ์ ์ ๋ณธ๋ฌธ
Development/CodingTest
[ํ๋ก๊ทธ๋๋จธ์ค] Python ์์ฃผํ์ง ๋ชปํ ์ ์
Kirok Kim 2022. 1. 13. 23:25
def solution(participant, completion):
p=sorted(participant)
c=sorted(completion)
for i in range(len(c)):
if p[i] != c[i]:
return p[i]
return p[len(p)-1]
hash๋ฅผ ์ด์ฉํ ํ์ด
def solution(participant, completion):
answer = ''
temp = 0
dic = {}
for part in participant:
dic[hash(part)] = part
temp += int(hash(part))
for com in completion:
temp -= hash(com)
answer = dic[temp]
return answer
- ...ํ์์ ์ด๋ค.....
๋ฐ์ํ
'Development > CodingTest' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํ๋ก๊ทธ๋๋จธ์ค] Python ์ ํ๋ฒํธ ๋ชฉ๋ก (0) | 2022.01.18 |
---|---|
[๋ฐฑ์ค] Python ํด์ฑ(hashing) (0) | 2022.01.18 |
ํด์ (0) | 2022.01.12 |
[ํ๋ก๊ทธ๋๋จธ์ค] Python ๋น๋ฐ์ง๋ (0) | 2022.01.09 |
[๋ฐฑ์ค] Python ์ง๋ฒ๋ณํ (0) | 2022.01.09 |
Comments