Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.

[2023-09-22] wooyeol #241#265

Merged
Woo-Yeol merged 1 commit into
mainfrom
wooyeol-#241
Sep 24, 2023
Merged

[2023-09-22] wooyeol #241#265
Woo-Yeol merged 1 commit into
mainfrom
wooyeol-#241

Conversation

@Woo-Yeol
Copy link
Copy Markdown
Member

PR Summary

뒤에 있는 큰 수 찾기
https://school.programmers.co.kr/learn/courses/30/lessons/154539

풀이시간
11 :42~48 13:38 ~ 14:10 (풀이 포기)

풀이 참고 : https://maximum-curry30.tistory.com/515

문제 조건
4 <= len(numbers) : N <= 1,000,000

시간 복잡도 :
O(N)

접근법
무슨 알고리즘으로 풀이 할 수 있을까? -> stack

  • 오큰수 처리 알고리즘이 존재
  • Stack을 사용하여 가장 위의 원소에 해당하는 값보다 현재 검사하는 원소의 값이 작을 때 해당 수가 오 큰수이다.

@Woo-Yeol Woo-Yeol self-assigned this Sep 22, 2023
@Woo-Yeol Woo-Yeol linked an issue Sep 22, 2023 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@limstonestone limstonestone 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
Contributor

@zsmalla zsmalla left a comment

Choose a reason for hiding this comment

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

참고한 풀이도 깔끔하네요! 우열님 기존 풀이처럼 2중 for문을 활용하면 어떤 예외던 N^2이 나오게 되어 시간초과가 발생하는 것 같습니다. 고생하셨습니다! 내일 다시 풀어보시죠

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

8시간 풀던 임우열 어디갔어!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ㅋㅋㅋㅋㅋㅋㅋㅋㅋ이제 그럴 시간은 없...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ㅋㅋㅋㅋㅋㅋㅋㅋㅋ이제 그럴 시간은 없...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이 풀이가 가장 깔끔한 정해인 것 같아요! 고생하셨습니다 우열님~~!!👍👍👍

@Woo-Yeol Woo-Yeol merged commit 878a9d2 into main Sep 24, 2023
@Woo-Yeol Woo-Yeol deleted the wooyeol-#241 branch September 24, 2023 15:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Programmers] 뒤에 있는 큰 수 찾기

4 participants