Conversation
LeeSongMi
approved these changes
May 4, 2025
Collaborator
There was a problem hiding this comment.
현재 스텝이 두 번째 스텝일때의 최대값을 구하는거여서
max_scores[c_step-1][0]로 한 칸 이전 스텝의 최대값을 가져오는것까지는 이해했는데
c_step >= 1 else 0을 해주는 부분이 잘 이해가 안돼서요 😢
혹시 저부분은 어떤 의미를 나타내는건가용?
Owner
Author
There was a problem hiding this comment.
s_score = max_scores[c_step-1][0]+c_score if c_step >= 1 else 0
안녕하세요 :)
위 구문은 3항 연산자입니다. 따라서 아래 코드와 동일한 역할을 하고 있습니다.
현재 스텝(c_step)이 두 번째 이후일 때부터 고려해주기 위해 c_step 값이 1 이상 (인덱스는 0부터 시작하기 때문)일 때부터 고려합니다.
if c_step >= 1:
s_score = max_scores[c_step-1][0]+c_score
else:
s_score = 0
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
To-do
Introduction
고민 방향