์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- 2๋จ๊ณ
- 1๋จ๊ณ
- hash
- JSP
- jquery
- ๋ฐฑ์ค
- Deque
- counter
- ์คํ๋ง
- JavaScript
- R
- Lambda
- ์ํด๋ฆฌ ์ฑ๋ฆฐ์ง
- ์คํ
- ์ฝ๋ฉํ ์คํธ
- ์๋ฐ
- MySQL
- ํฌ ํฌ์ธํฐ
- ํ
- ์ฝ๋์
- ํด์
- ๋ฐฑ์ค c++
- ์ฅ๊ณ
- ํ๋ก๊ทธ๋๋จธ์ค
- ๋ฐฐ์ด
- ๋ ์์ ํฉ
- Servlet
- ํ์ด์ฌ
- Set
- ๊ฐ๋ฆ
- Today
- Total
๋ชฉ๋กํ (5)
Development
๋ด ์ฝ๋ def solution(board, moves): answer = 0 q = [] l=0 while True: if (len(moves)-1) == l: break for i in board: if (i[moves[l]-1]) !=0: q.append(i[moves[l]-1]) i[moves[l]-1] = 0 break l+=1 while True: if len(q)>=2 and (q[len(q)-2] == q[len(q)-1]): answer+=2 q.pop() q.pop() else: break return answer ์นด์นด์ค ๋ฌธ์ !!! ์นด์นด์ค ๋ฌธ์ ๋ค์ ๊ท์ฝ๋ค..,, ๋ฌธ์ ์ ์นด์นด์ค ์บ๋ฆญํฐ๋ค์ด ๋์จ๋ค...,,ใ ใ ๋ฌธ์ ํธ๋๋ฐ๋ ๋ณ๋ก ์๊ฐ์ด ์๊ฑธ๋ ธ๋๋ฐ.. ๋ฉ๋๋ฆฌ๋ฉด์ ํ๋ค๊ฐ len(q)๋ฅผ len์ผ..
ํด ๋๋์ด ํ์๋ค!!!!! ์ฝ๋๊ฐ ๋ง์ด., ๋๋ฌ์ด๊ฑฐ๊ฐ๋ค ใ .ใ ๋ด ์ฝ๋ ์ค๋ช ํ๊ณ ๋นจ๋ฆฌ ๋ค๋ฅธ์ฌ๋๊บผ ๋ถ์ํด๋ด์ผ์ง... ๋ด ์ฝ๋ def solution(bridge_length, weight, truck_weights): from collections import deque crossing_truck = deque([]) cnt=0 i=0 while True: if i==len(truck_weights) and len(crossing_truck)==0: break if len(crossing_truck) !=0: if crossing_truck[0][1] == bridge_length: crossing_truck.popleft() if i!=len(truck_weights): if weight>= (truck..
ํ, ์คํ์ ์ฃผ์๊ฐ๊ฒฉ! ์ด๋ ค์ด ๋ฌธ์ ๋ ์๋๋ฐ.. ๋ฌธ์ ์ดํดํ๋๋ฐ ์๊ฐ์ด ์ข.. ๊ฑธ๋ ธ๋ค. ์์์ ํ์๋ ๊ธฐ๋ฅ๊ฐ๋ฐ์ด๋ ํ๋ฆฐํฐ๋ณด๋ค ํจ ์ฌ์ด๊ฑฐ๊ฐ๋ค!! ๊ทผ๋ฐ ํ ์คํ ๋ฌธ์ ๋ฐ.. ๋๋ ๊ทธ๋ฅ ์ด์คํฌ๋ฌธ์ผ๋ก ํ์๋ค. ํจ์จ์ฑ ํ ์คํธ ํต๊ณผํ๋ฉด ๋๊ฑด๊ฐ?..ใ ใ ๋ด ์ฝ๋ 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]
์คํ, ํ๋ถ๋ถ 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) #..