ํท๊ฐ๋ฆฌ๋๊ฑฐ ์ ๋ฆฌ
์์ด : ์์ ์๊ด ์์
์กฐํฉ : ์์ ์๊ด ์์
[์ํ] ์์ด, ์กฐํฉ ๊ณต์ ์ด์ ๋ฆฌ
ํฉํ ๋ฆฌ์ผ ( ! ) ํฉํ ๋ฆฌ์ผ์ด๋ ์๋ก ๋ค๋ฅธ n๊ฐ๋ฅผ ๋์ดํ๋ ๊ฒฝ์ฐ์ ์๋ฅผ ์๋ฏธํฉ๋๋ค. ๊ธฐํธ๋ก๋ n! ์ด๋ ๊ฒ ์ฐ๊ณ ๊ณ์ฐ์ n๋ถํฐ 1์ฉ ์ค์ฌ๋๊ฐ๋ฉด์ 1์ด ๋ ๋๊น์ง์ ๋ชจ๋ ์๋ฅผ ๊ณฑํฉ๋๋ค. ์์ด ( nPr ) ์์ด์ด
coding-factory.tistory.com
enumerate() ๋ด์ฅ ํจ์ : ์ธ๋ฑ์ค์ ์์๋ก ์ด๋ฃจ์ด์ง ํํ์ ๋ง๋ค์ด์ค๋ค. for๋ฌธ์์ ์ฌ์ฉ
ํ์ด์ฌ์ enumerate() ๋ด์ฅ ํจ์๋ก for ๋ฃจํ ๋๋ฆฌ๊ธฐ
Engineering Blog by Dale Seo
www.daleseo.com
728x90