Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π λ¬Έμ λ§ν¬
λ°±μ€ - 1νλ
βοΈ μμλ μκ°
1μκ°...?
β¨ μλ μ½λ
λ¬Έμ μμ½
μ£Όμ΄μ§ μ«μ 리μ€νΈμ κ° μ«μλ€ μ¬μ΄μ λνκΈ°(+) λλ λΉΌκΈ°(-) μ°μ°μ ν΄μ μ°μ°μ κ²°κ³Όκ° λ¦¬μ€νΈμ λ§μ§λ§ μ«μκ° λλλ‘ νλ κ²½μ°μ μλ₯Ό ꡬνλ κ²
νμ΄ λ°©μ
DP μ¬μ© μ΄μ β
2-1. μ΄ λ¬Έμ μμ DP ν μ΄λΈ
dp[i][j]
λiλ²μ§Έ
μ«μκΉμ§ μ΄μ©ν΄μjκ°
μ λ§λ€ μ μλ κ²½μ°μ μλ₯Ό μλ―Έν΄κ²° κ³Όμ
μ½λλ‘ μ€λͺ
1. μ΄κΈ° μν:
2. 첫 λ²μ§Έ λ¨κ³ (i=1, nums[i]=3):
j=8μΌ λ:
3. λ λ²μ§Έ λ¨κ³ (i=2, nums[i]=2):
! μ΄λ¬ν λ°©μμΌλ‘ DP ν μ΄λΈ μ±μ°κΈ° !
π» μ΅μ’ μ½λ
π μλ‘κ² μκ²λ λ΄μ©