구현 : 머리속에 있는 알고리즘을 소스코드로 바꾸는 과정
## 입력 받기
n = int(input())
x, y = 1, 1
plans = input().split()
## LRUD 이동 방향
dx = [0,0,-1,1]
dy = [-1,1,0,0]
move_types = ['L', 'R', 'U', 'D']
## 이동 계획을 하나씩 확인
for plan in plans:
## 이동 후 좌표 구하기
for i in range(len(move_types)): #move_types 만큼 for문 돌리기
if plan == move_types[i]:
nx = x + dx[i]
ny = y + dy[i]
## 공간을 벗어나는 경우
if nx < 1 or ny < 1 or nx > n or ny > n :
continue
## 이동 수행
x, y = nx, ny
print(x, y)
h = int(input())
count = 0
for i in range(h+1):
for j in range(60):
for k in range(60):
if '3' in str(i) + str(j) + str(k) :
count += 1
print(count)
## 현재 나이트 위치 입력받기
location = input()
row = int(location[1])
col = int(ord(location[0])) - int(ord('a')) + 1
## 나이트 이동 가능 8가지 방향
steps = [(-2, -1), (-1, -2), (1, -2),(2, -1),(2, 1),(1, 2),(-1, 2),(-2, 1)]
## 8가지 방향에 대하여 각 위치로 이동이 가능한지 확인
result = 0
for step in steps:
#이동하고자 하는 위치 확인
next_row = row + step[0]
next_col = col + step[1]
## 해당 위치로 이동이 가능하다면 카운트 증가
if next_row >= 1 and next_row <= 8 and next_col >= 1 and next_col <= 8:
result += 1
print(result)
## 입력 받기
a = input()
result = []
value = 0
## 문자 하나씩 확인
for i in a:
## 알파벳인 경우 리스트 삽입
if i.isalpha():
result.append(i)
## 숫자인 경우 따로 더하기
else:
value += int(i)
## 알파벳 오름차순 정리
result.sort()
## 숫자가 하나라도 존재하는 경우 가장 뒤에 삽입
if value != 0:
result.append(str(value))
## 최종 결과 리스트 문자열로 변환하여 출력
print(''.join(result))
구현도 어렵다... 공부할게 너무 많아...