Conversation
Do-ho
approved these changes
Jun 22, 2021
UiHyeon/week_3/array_turn.py
Outdated
Comment on lines
3
to
12
| graph = [] | ||
| num = 1 | ||
| #행렬 생성 | ||
| for i in range(rows): | ||
| temp = [] | ||
| for j in range(columns): | ||
| temp.append(num) | ||
| num += 1 | ||
|
|
||
| graph.append(temp) |
UiHyeon/week_3/array_turn.py
Outdated
Comment on lines
17
to
18
| slave = graph[base_r-1][end_c-1] | ||
| mini = slave |
Collaborator
Author
There was a problem hiding this comment.
아 이건 숫자를 이동하다 보면 처음 이동시킨 숫자가 회전문에서 제외되는데 이 숫자를 마지막이동 자리에 다시 끼워넣어줘야합니다 . 그래서 slave라는 변수로 값을 저장했습니다.
Member
There was a problem hiding this comment.
변수명이 처음 보는 사람이 알아보기 어려워요 ㅠㅠ 더 가독성 있는 변수명을 써보자요~~!
Collaborator
Author
There was a problem hiding this comment.
아ㅋㅋㅋ 맞습니다 ㅋㅋㅋ 개그 소재로 사용했는데 변경할게요 XD
UiHyeon/week_3/bracket_turn.py
Outdated
| @@ -0,0 +1,36 @@ | |||
| from collections import deque | |||
|
|
|||
| def right(deq): | |||
Member
There was a problem hiding this comment.
right도 좋지만 string이 괄호 검사로 부터 valid한지를 확인하는 것이기 때문에 isValidBracket과 같이 is를 앞에 붙여주면 좋을 것 같네요.
UiHyeon/week_3/bracket_turn.py
Outdated
Comment on lines
6
to
15
| if check == '(' or check == '{' or check == '[': | ||
| stack.append(check) | ||
| if stack: | ||
| if check == ')' and stack.pop() != '(': | ||
| return False | ||
| if check == '}' and stack.pop() != '{': | ||
| return False | ||
| if check == ']' and stack.pop() != '[': | ||
| return False | ||
| else: return False |
Member
There was a problem hiding this comment.
이부분은 정규표현식으로도 한번 짜보기를 추천드립니다 ㅎㅎ 물론 짜는 속도는 if 문을 쓰는게 빠르겠죠?
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.
📘 구현
💬 후기