Merged
Conversation
JooKangsan
approved these changes
Jan 11, 2025
Collaborator
JooKangsan
left a comment
There was a problem hiding this comment.
전체적으로 설명이 잘 되어있어서 읽기 편했던거 같아요!! 수고하셨습니다!
Collaborator
There was a problem hiding this comment.
매 반복마다 pop() 연산을 수행하므로 O(n) 시간 복잡도를 가집니다!!
reverse()메서드를 사용해 보는 건 어떨까요??
Moonjonghoo
approved these changes
Jan 14, 2025
Collaborator
Moonjonghoo
left a comment
There was a problem hiding this comment.
강산님이 리뷰를 잘해주셔서 떠오르는게없었습니다
한주간 고생하셨어요!
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.
📌 푼 문제
📝 간단한 풀이 과정
문자열 뒤집기
스프레드 문법을 사용해 문자열을 배열로 변환한 후, for 반복문을 통해 배열을 순회하면서 pop 메서드를 사용해 배열의 마지막 요소를 꺼내 answer에 추가하였습니다.
컨트롤 제트
split 메서드로 문자열을 공백 기준으로 나눠 배열로 변환한 뒤, 배열을 순회하며 각 요소가 'Z'인 경우 이전 값을 answer에서 빼고, 숫자인 경우 answer에 더하며 값을 갱신하도록 했습니다.
크레인 인형뽑기 게임
moves 배열에 따라 board에서 인형을 하나씩 꺼내 stack 배열에 저장하고, 같은 인형이 연속으로 쌓이면 stack에서 제거하며 점수를 2점씩 추가하도록 했습니다.
올바른 괄호
문자열을 순회하며 조건문을 통해 여는 괄호 '('는 stack 배열에 추가하고, 닫는 괄호 ')'는 stack 배열에서 제거하며 짝을 맞추는 방식으로 처리하였고, 순회가 끝난 후 stack이 비어 있으면 true로 반환하도록 했습니다.
다트 게임
정규식을 이용해 매개변수로 받은 문자열을 숫자, 문자, 기호들을 각각 나눈 배열을 반환하고, 배열을 순회하면서 각 요소가 문자나 기호일 때 해당 조건에 맞는 연산을 하도록 했습니다.