# Process
# 1. Input array, commands
# 2. Iterate all commands
# 2.1. Get sub array using commands
# 2.2. Get target value from subarray
# 2.3. Put target_value into the result_array
# 3. Return result array
def solution(array, commands):
result_array = []
for command in commands:
temp_array = array[command[0] - 1 : command[1]]
temp_array.sort()
result_array.append(temp_array[command[2]-1])
return result_array
# def solution(array, commands):
# result_array = []
# for command in commands:
# temp_array = []
# i = command[0]-1
# while i <= command[1]-1:
# temp_array.append(array[i])
# i += 1
# temp_array.sort()
# result_array.append(temp_array[command[2]-1])
# return result_array
스택/큐 03 - 기능개발, 프로그래머스, 알고리즘, Programmers, Stack, Queue, Hash, 코딩테스트, Algorithm, 풀
# Process # 1. Input progresses and speeds # 2. Iterate while progresses is empty # 2.1. Iterate all # 2.1.1. Add all speed of work # 2.2. Iterate from begin to t..
itdar.tistory.com
강화학습 MDP 기본 개념1, Reinforcement Learning, Markov Decision Process, AI, Artificial Intelligence, agent, state, act
강화학습의 Finite MDP (유한 마르코프 결정 프로세스) 프레임은 아래와 같은 것이 반복됨 s -> a -> r -> s -> a -> r s 는 state (상태) a 는 action (행동) r 은 reward (보상) 상태0 에서 행동0 을 하고, 보상..
itdar.tistory.com
LeetCode #021 MergeTwoSortedLists. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,
LeetCode #021 MergeTwoSortedLists. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인..
itdar.tistory.com
C++ Math - sqrt (square root, 제곱근, 루트). stl, math.h, 씨쁠쁠, example code, 예제코드
C++ Math - sqrt (squareRoot, 제곱근)C++ Math - sqrt (squareRoot, 제곱근). stl, math.h, 씨쁠쁠, example code, 예제코드C++ Math - sqrt (square root, 제곱근, 루트). stl, math.h, 씨..
itdar.tistory.com