์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- JavaScript
- counter
- ํ๋ก๊ทธ๋๋จธ์ค
- Lambda
- ์๋ฐ
- Deque
- ํ์ด์ฌ
- ์ฅ๊ณ
- ์คํ
- ๋ฐฑ์ค
- jquery
- ํฌ ํฌ์ธํฐ
- ๋ ์์ ํฉ
- ํ
- ์ฝ๋์
- MySQL
- 2๋จ๊ณ
- Servlet
- ์ํด๋ฆฌ ์ฑ๋ฆฐ์ง
- ๋ฐฑ์ค c++
- Set
- R
- JSP
- hash
- ์ฝ๋ฉํ ์คํธ
- ํด์
- ์คํ๋ง
- 1๋จ๊ณ
- ๋ฐฐ์ด
- ๊ฐ๋ฆ
- Today
- Total
๋ชฉ๋ก2๋จ๊ณ (4)
Development
ํ, ์คํ์ ์ฃผ์๊ฐ๊ฒฉ! ์ด๋ ค์ด ๋ฌธ์ ๋ ์๋๋ฐ.. ๋ฌธ์ ์ดํดํ๋๋ฐ ์๊ฐ์ด ์ข.. ๊ฑธ๋ ธ๋ค. ์์์ ํ์๋ ๊ธฐ๋ฅ๊ฐ๋ฐ์ด๋ ํ๋ฆฐํฐ๋ณด๋ค ํจ ์ฌ์ด๊ฑฐ๊ฐ๋ค!! ๊ทผ๋ฐ ํ ์คํ ๋ฌธ์ ๋ฐ.. ๋๋ ๊ทธ๋ฅ ์ด์คํฌ๋ฌธ์ผ๋ก ํ์๋ค. ํจ์จ์ฑ ํ ์คํธ ํต๊ณผํ๋ฉด ๋๊ฑด๊ฐ?..ใ ใ ๋ด ์ฝ๋ def solution(prices): answer = [] for i in range(len(prices)-1): answer.append(0) for j in range(i+1,len(prices)): if prices[i]
ใ ใ ๋์ ๋๋ฆฌ๊น์ง ๋ง๋ค์๋๋ฐ ๊ณ์ฐ์ ์ด๋ป๊ฒ ํ ๊ฑด์ง ๊ณ ๋ฏผํ๋ค๊ฐ.. ๋ธ๋ก๊ทธ๋ดค๋ค ใ .. ๋ธ๋ก๊ทธ์์ ๊ณ์ฐ ๋ฐฉ๋ฒ๋ง ๋ณด๊ณ ์ฝ๋๋ ๋ด๊ฐ ์ง๋ดค๋ค!ใ ์ค๋ช ์ ์ฝ๋ ์์ ๋ค์ด๊ฐ์๋ค. ๋ด ์ฝ๋ def solution(clothes): dic = {} sol=1 #์ข ๋ฅ๋ฅผ key, ์๋ฅผ value๋ก ๋์ ๋๋ฆฌ๋ฅผ ๋ง๋ค์ด์ค๋ค. for key in clothes: if key[1] in dic: dic[key[1]]+=1 else: dic[key[1]] = 1 # ๊ฐ ์ข ๋ฅ๋ณ๋ก ์ ๋ ๊ฒฝ์ฐ์ ์๋ฅผ ๊ณฑํด์ค๋ค. ๋ง์ง๋ง์ ์ ๋ถ ์ ์ง ์๋ ๊ฒฝ์ฐ์ ์๋ฅผ ๋นผ์ค๋ค. for key in dic: sol*=dic[key]+1 return sol-1 ๋ค๋ฅธ์ฌ๋ ์ฝ๋ def solution(clothes): from collections import Coun..
์คํ, ํ๋ถ๋ถ 2๋จ๊ณ ๋ฌธ์ ํ๋ฆฐํฐ๋ค! ์ผ์ผ ใ ใ ์ด๋ ต๋ค.. ๋จผ์ ๋ด๊ฐ ํผ ์ฝ๋์ด๋ค! def solution(priorities, location): cnt=0 while True: if priorities[0] < max(priorities): if location == 0: location = len(priorities) -1 else: location-=1 priorities.append(priorities.pop(0)) else: if location == 0: return cnt+1 else: cnt+=1 location-=1 priorities.pop(0) ๋จผ์ priorities์ ์ฒซ๋ฒ์งธ ์์์ priorities์์ ์ ์ผ ํฐ ์์๋ฅผ ๋น๊ตํ๋ค. ๋ง์ฝ priorities[0]๋ณด๋ค ํฐ ์์๊ฐ ์์..
์ฝ๋๋ฅผ ํจ์จ์ ์ด๊ฒ ์์ง์ ๊ทธ๋ฐ์ง ๋ชจ๋ฅด๊ฒ ๋๋ฐ.. ๋ต์ ๋นจ๋ฆฌ๋์๋ค!! ์ผ๋จ ๋ค๋ฅธ ๋ถ ์ฝ๋ ๋ณด๊ธฐ์ ์ ๋ด๊ฐ ์ง ์ฝ๋ ์ค๋ช ์ ์ ๊ฒ ๋ค.,, import math def solution(progresses, speeds): answer = [] for i in range(len(progresses)): progresses[i] = math.ceil((100-progresses[i])/speeds[i]) # ์์ ์ด ๋ฉฐ์น ๊ฑธ๋ฆฌ๋์ง ๊ณ์ฐ์ ํด์ค๋ค. cnt=0 while len(progresses)!=1: # progresses[1]๊ณผ ๋น๊ตํ๋ฏ๋ก ๊ธธ์ด๊ฐ 1์ด ์๋๋๊น์ง ๋ฐ๋ณต๋ฌธ ์คํ. if progresses[0] < progresses[1]: # ์ฒซ๋ฒ์งธ ์์ ์ด ๋๋ฒ์งธ ์์ ๋ณด๋ค ์ ๊ฒ ๊ฑธ๋ฆฌ๋ฉด progresses.pop(0) #..