Skip to content

[WEEK06-2] 최준호#26

Merged
raejun92 merged 1 commit into
mainfrom
raejun
Mar 22, 2026
Merged

[WEEK06-2] 최준호#26
raejun92 merged 1 commit into
mainfrom
raejun

Conversation

@raejun92
Copy link
Copy Markdown
Collaborator

이렇게 풀었어요

1. Contains Duplicate

  • 문제를 풀었어요.
  • 풀이 시간 : 2분

1) 복잡도 계산

시간 복잡도: O(n)


2) 접근 아이디어

Set 자료구조를 이용하여 풀이했다.
배열을 순회하면서, Set에 요소가 있는지 확인하고, 있으면 true를 반환하고, 없으면 Set에 요소를 추가했다.
배열을 모두 순회한 후에도 중복된 요소가 없으면 false를 반환했다.


3) 회고

이전 문제들에 비해 매우 간단한 문제였다.
set, array, map 등 다양한 자료구조를 이용해서 풀 수 있을 것 같다.



2. Roman to Integer

  • 문제를 풀었어요.
  • 풀이 시간 : 26분

1) 복잡도 계산

시간 복잡도: O(n)


2) 접근 아이디어

문자열을 순회하면서, 현재 문자와 다음 문자를 비교하여, 현재 문자가 다음 문자보다 크거나 같으면 num에 더하고, 그렇지 않으면 num에서 뺐다.
마지막 문자에 대해서는 순회가 끝난 후에 num에 더했다.


3) 회고

문제를 다소 어렵게 생각했다.
뭔가 특정한 규칙이 있을 것 같아 규칙을 찾는 것에 집중하다보니 시간을 많이 소모했다.
문제에서 뺄셈이 될 수 있는 경우가 정해져있기 때문에 많은 경우의 수를 고려할 필요가 없었다.



Copy link
Copy Markdown
Member

@doitchuu doitchuu left a comment

Choose a reason for hiding this comment

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

고생많으셨습니다!!
문제 풀이가 깔끔하군요👍

Copy link
Copy Markdown
Collaborator

@sik9252 sik9252 left a comment

Choose a reason for hiding this comment

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

두 문제 모두 핵심 아이디어를 잘 잡아서 깔끔하게 구현하신 것 같습니다!

@raejun92 raejun92 merged commit 0e1f458 into main Mar 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants