Skip to content

[Week 6] SORTGAME self review - profitjean #191

@profitjean

Description

@profitjean

SORTGAME self review

1. 해결 시도 과정

BFS로 풀이를 해보려고 했고, 입력데이터를 최적화한다는 것에 초점을 두어
길이를 8로 통일시켜준뒤에 최소 정렬 횟수를 계산하려고 했습니다.

2. 작성한 코드와 설명

import sys
from collections import deque
input = sys.stdin.readline
def bfs(start, length):
    queue = deque()
    queue.append((start, 0))

case = int(input().rstrip())
dp = {}
array = [str(num+1) for num in range(8)]
# bfs 호출해야함
for _ in range(case):
    n = int(input().rstrip())
    array = list(map(int, input().rstrip().split()))
    sorted_array = list(sorted(array))
    mapped = dict(zip(sorted_arr, range(1,N+1)))

3. 막힌 점 및 개선 사항

아직 구현하지 못한 bfs 부분은
큐의 값이 존재하는 동안반복문을 통해 구현을 해보려고 했습니다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    2기스터디 2기WAWrong Answer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions