인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

slog242474's profile image
slog242474

asked

Introduction to Python Algorithm Problem Solving (Coding Test Preparation)

8. Finding Permutations (DFS)

중복 제거 방식

Written on

·

191

1

체크변수 없이 res 에 있는 값을 체크하는 방식은 array 탐색이 발생하여 비효율적이라 권장되지 않는거겠지요?
        for i in range(1, n+1):
            if not i in res:
                res[L] = i
                DFS(L+1)
        res[L] = 0
python코테 준비 같이 해요!

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

네. 체크로 하는게 좋습니다.

slog242474's profile image
slog242474

asked

Ask a question