강의

멘토링

커뮤니티

Inflearn Community Q&A

minhyung01239529's profile image
minhyung01239529

asked

Introduction to Python Algorithm Problem Solving (Coding Test Preparation)

9. Guessing the sequence (permutation, Pascal application)

combination 리스트 생성

Written on

·

400

0

안녕하세요. 강사님.
DFS 너무 어렵지만ㅠㅠ 강의 잘 듣고 있습니다
 
혹시 combination 결과를 담을 b 리스트를 생성할 때
nCr = n! / ((n-r)! * r!)을 활용하여
for i in range(n):
        b[i] = int(factorial(n-1) / (factorial(n-1-i) * factorial(i)))
factiorial을 이용하여 코드를 짜봤습니다.
 
vscode를 이용하여 코드 짰는데 자동으로 from math import factorial 생성됐더라구요...
실제 코테에서는 이런식으로 하면 안되는거죠??
python코테 준비 같이 해요!

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

라이브러리를 제한하는 회사도 많습니다. 직접 하시는게 좋습니다.

minhyung01239529's profile image
minhyung01239529

asked

Ask a question