π
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| λ¬Έμ 1.13: κ³ μ ν μ μμ μ§ν©μΌλ‘ λ°°μ΄μ΄ μ£Όμ΄μ§λ©΄, κ°λ₯ν λͺ¨λ λΆλΆμ§ν©μ λ°ννμ. | |
| μ€λ³΅λ λΆλΆμ§ν©μ νμ©νμ§ μλλ€. | |
| μ λ ₯μΌλ‘ [1, 2, 3]μ΄ μ£Όμ΄μ§λ©΄, κ²°κ³Όλ‘ [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]] μ λ°ννλ©΄ λλ€. | |
| ## μ ν μ¬ν | |
| - μ λ ₯μ κ³ μ ν μ μμ μ§ν©μΌλ‘ μ΄λ£¨μ΄μ Έμλ€. | |
| - μ μν λ°°μ΄ | |
| - λ°νκ°μ 2μ°¨μ μ μν λ°°μ΄ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| λ¬Έμ 1.7: μ λ ¬λ λ°°μ΄ nums1, nums2κ° μ£Όμ΄μ§κ³ , κ°κ°μ ν¬κΈ°λ mκ³Ό nμ΄λ€. | |
| μ λ ¬μ μ μ§νλ©΄μ nums1 λ°°μ΄λΆν° μ±μλκ° nums2κΉμ§ νμ₯μ ν΄λ³΄μ. | |
| """ | |
| from typing import List | |
| def merge(nums1: List[int], m: int, nums2: List[int], n: int) -> List[int]: | |
| for i, nums1_item in enumerate(nums1): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| λ¬Έμ 1.6: μ£Όμ΄μ§ λ λ°°μ΄ (nums1, nums2)μ μ λ ¬μ μ μ§νλ©΄μ | |
| λ³ν©μ ν΄λ³΄μ. | |
| """ | |
| from typing import List | |
| def merge(nums1: List[int], m: int, nums2: List[int], n: int) -> None: | |
| i = m - 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| λ¬Έμ 1.5.1: μ λ ¬λ λ°°μ΄κ³Ό λͺ©νκ°μ΄ μμ λ, λ°°μ΄μ ν΄λΉ μΈλ±μ€λ₯Ό λ°ννκ³ , | |
| μ°Ύμ§ λͺ»νλ€λ©΄, μ λ ¬λ λ°°μ΄μ΄ λλλ‘ λͺ©νκ°μ΄ λ°°μ΄μ λ€μ΄κ°μΌ νλ μΈλ±μ€λ₯Ό | |
| ꡬνλ λ¬Έμ μ΄λ€. | |
| """ | |
| from typing import List | |
| def searchIndex(nums: List[int], target: int) -> int: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| λ¬Έμ : λ°°μ΄μ μλ μ«μμ μ‘°ν©μΌλ‘ νΉμ μ«μλ₯Ό λ§λ€ μ μλμ§λ₯Ό μμ보λ λ¬Έμ μ΄λ€. | |
| μ΄ν΄κ° μ λμ§ μλλ€λ©΄, νμ€ νμ€ μ½ μ€νμ κ·Έλ €λ³΄λ©΄μ μ΄ν΄ν΄λ³΄λ κ²μ΄ μ’λ€. | |
| """ | |
| from typing import List | |
| def group_sum(nums: List[int], subset: List[bool], target: int, i: int) -> bool: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| ## λ¬Έμ : 1.4 | |
| - μ λ ¬λ λ°°μ΄μ μμλ€μ μ€λ³΅ μμ΄, λ¨ 1λ²μ©λ§ κ°μ§ μ μλλ‘ μ£Όμ΄μ§ λ°°μ΄μ κ·Έλλ‘ μμ νκ³ , | |
| μμ λ λ°°μ΄μ μλ‘μ΄ κΈΈμ΄λ₯Ό λ°ννλΌ. | |
| """ | |
| from typing import List | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| ## λ¬Έμ : 1.3 λμμ ν© μ°ΎκΈ° | |
| μ£Όμ΄μ§ μ μν λ°°μ΄μμ 2κ°μ μ«μλ₯Ό μ ννμ¬, λν κ°μ΄ νΉμ λͺ©νκ°μ λ§λ€λ, | |
| κ·Έ μ νν 2κ°μ μ μκ° μλ λ°°μ΄μ μΈλ±μ€λ₯Ό λ°ννλ νλ‘κ·Έλ¨μ μμ±νλΌ. | |
| μ λ ₯κ° : nums = [2, 7, 10, 19] target = 9 | |
| μΆλ ₯κ° : [0, 1] | |
| """ | |
| from typing import List |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| # λ¬Έμ 1.11 λΉ μ§ μ«μ μ°ΎκΈ° | |
| - μ£Όμ΄μ§ μ μν λ°°μ΄μ 0 ~ n κΉμ§μ μ«μλ₯Ό λ΄κ³ μλλ° μ΄ μ€μ λΉ μ§ μ«μλ₯Ό μ°Ύμ보μ. | |
| - λ°°μ΄μ κ°μ 0μμ μμνμ¬ nκΉμ§ n + 1κ°μ μμλ₯Ό κ°μ§ μ μμ§λ§, λ°°μ΄μ ν¬κΈ°λ nμΌλ‘ | |
| μ΄ μ«μ μ€μ νλλ λΉ μ Έμλ€λ λ»μ΄λ€. | |
| - μλ₯Ό λ€μ΄μ, nums = [3, 1, 0] μ΄λΌλ©΄ λΉ μ§ μ«μλ 2μ΄λ€. | |
| ## μ ν μ¬ν |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| ## λ¬Έμ : 1.10 λ°°μ΄μ νμ | |
| - μ λ ₯μΌλ‘ μ μν λ°°μ΄κ³Ό k κ°μ΄ μ£Όμ΄μ§λ©΄, κ° μμλ₯Ό μ°μΈ‘μΌλ‘ | |
| k λ² μ΄λ λ° νμ μ ν΄λ³΄μ. | |
| - kλ μμ μ μ κ°μ΄λ€. | |
| - μλ₯Ό λ€μ΄μ, nums λ°°μ΄μ [1, 2, 3, 4] κ° μκ³ , kκ° 1μ΄λΌλ©΄ μμλ μ°μΈ‘μΌλ‘ 1μΉΈμ© | |
| μ΄λ λ° νμ νμ¬ [4, 1, 2, 3] μ΄ λλ€. | |
| ## μ νμ¬ν : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| ## λ¬Έμ : λ°°μ΄μμ λ€μμ μμ μ°ΎκΈ° | |
| - μ μν λ°°μ΄μ΄ μ£Όμ΄μ‘μ λ, λ€μμ μμλ₯Ό μ°Ύμ보μ. | |
| - λ€μμ μμλ λ°°μ΄ λ΄μμ [n / 2] λ² (floor(n / 2))λ₯Ό μ΄κ³Όνμ¬ λνλλ μμλ₯Ό λ§νλ€. | |
| - μλ₯Ό λ€μ΄μ, λ°°μ΄ μμμ μ΄ κ°μκ° 9κ°λΌλ©΄, n / 2λ 4.5μ΄λ€. κ²°κ΅μ 5λ² μ΄μ λνλλ μμλ₯Ό μ°ΎμΌλ©΄ λλ€. | |
| - λ°°μ΄μ νμ 1κ° μ΄μμ μμλ₯Ό κ°μ§κ³ μμΌλ©°, λ€μμ μκ° λ¬΄μ‘°κ±΄ νλ μ‘΄μ¬ νλ€κ³ κ°μ νμ. | |
| ## μ νμ¬ν : | |
| - μ μν λ°°μ΄μ΄ μ£Όμ΄μ§λ€. |