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

Inflearn Community Q&A

boykhk982624's profile image
boykhk982624

asked

Introduction to Python Algorithm Problem Solving (Coding Test Preparation)

4. Subsets with the same sum (DFS)

시간복잡도를 줄이기 위한 방법

Written on

·

602

0

시간 복잡도를 줄이기 위해 sum이 total의 절반을 넘어가면 return 해주는 방법은 이해 됐습니다. 갑자기 생각이 난게 어차피 total이 홀수면 합이 같은 두 부분 집합을 만들 수 없으니 total이 홀수일때 재귀가 돌지 않게 해주면 더 시간복잡도가 줄어들지 않을까요?

python코테 준비 같이 해요!

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

네. 맞습니다. 항상 그런 고민을 하면 좋은 프로그래머로 성장할 겁니다.

boykhk982624's profile image
boykhk982624

asked

Ask a question