Skip to content

Conversation

sonjh1217
Copy link
Contributor

@sonjh1217 sonjh1217 commented Aug 25, 2025

답안 제출 문제

작성자 체크 리스트

  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

검토자 체크 리스트

Important

본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!

  • 바로 이전에 올라온 PR에 본인을 코드 리뷰어로 추가해주세요.
  • 본인이 검토해야하는 PR의 답안 코드에 피드백을 주세요.
  • 토요일 전까지 PR을 병합할 수 있도록 승인해주세요.

@@ -0,0 +1,27 @@
class Solution {
func maxArea(_ height: [Int]) -> Int {
var heights = height
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드가 깔끔하고 좋네요 👍 height를 안쓰고, heights를 새로 만들어서 쓰시는 이유가 있을까요?

Copy link
Contributor Author

@sonjh1217 sonjh1217 Aug 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func maxArea(_ height: [Int]) -> Int { 라인은 leetCode에서 자동생성된건데.. 제가 습관이 되어서 Collection 타입들은 s가 붙어야 Collection으로 읽혀서요ㅎㅎ Swift에서 권장되는 방식입니답!

node.isEndOfWord = true
}

// O(m) ~ O(26^m) time / O(1) space
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

공간복잡도가 왜 O(1)이라고 생각하셨는지 여쭤봐도 될까요?? word의 길이만큼 공간이 필요하지 않나요..? 제가 잘 몰라서 여쭤봅니다..!!! 코드가 엄청 깔끔하고 좋네요 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e90ae4f 와 감사합니다! Array(word)며 재귀 스택 쌓이는거며 다 O(m)인데.. 왜 저렇게 생각했는지 모르겠네요ㅠ 아직 재귀에 대해서 잘 파악을 못해서 그랬던 것 같아요. 감사합니답!

@sonjh1217 sonjh1217 merged commit 2f0d644 into DaleStudy:main Aug 31, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from Solving to Completed in 리트코드 스터디 5기 Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

2 participants