Skip to content

Conversation

LHyunn
Copy link
Collaborator

@LHyunn LHyunn commented Jan 13, 2023

문제 설명

0 또는 양의 정수가 주어졌을 때, 정수를 이어 붙여 만들 수 있는 가장 큰 수를 알아내 주세요.

예를 들어, 주어진 정수가 [6, 10, 2]라면 [6102, 6210, 1062, 1026, 2610, 2106]를 만들 수 있고, 이중 가장 큰 수는 6210입니다.

0 또는 양의 정수가 담긴 배열 numbers가 매개변수로 주어질 때, 순서를 재배치하여 만들 수 있는 가장 큰 수를 문자열로 바꾸어 return 하도록 solution 함수를 작성해주세요.

제한 사항
  • numbers의 길이는 1 이상 100,000 이하입니다.
  • numbers의 원소는 0 이상 1,000 이하입니다.
  • 정답이 너무 클 수 있으니 문자열로 바꾸어 return 합니다.
입출력 예
numbers return
[6, 10, 2] "6210"
[3, 30, 34, 5, 9] "9534330"

※ 공지 - 2021년 10월 20일 테스트케이스가 추가되었습니다.

@LHyunn LHyunn self-assigned this Jan 13, 2023
@LHyunn LHyunn changed the title Create 가장 큰 수.py 문제풀이 가장 큰 수.py Jan 13, 2023
Copy link
Member

@Kimdongui Kimdongui left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

Choose a reason for hiding this comment

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

deque 를 사용해보면 어떨까요!

Ref

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

이 문제에서 시간복잡도 면에서의 이득 외에 더 얻을 것이 있을까요?

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.

2 participants