Skip to content

kyj 프로그래머스 마법의 엘리베이터#175

Open
yongjun-0903 wants to merge 1 commit into
algorithm1313:mainfrom
yongjun-0903:05-19
Open

kyj 프로그래머스 마법의 엘리베이터#175
yongjun-0903 wants to merge 1 commit into
algorithm1313:mainfrom
yongjun-0903:05-19

Conversation

@yongjun-0903
Copy link
Copy Markdown
Collaborator

📝 문제 정보

  • 문제 이름: 마법의 엘리베이터
  • 출처: 프로그래머스

🚀 해결 방법

  • 예제를 봤을 때 5를 기준으로 더하거나 빼는 식으로 판단할 수 있었음
  • 처음엔 첫 자리 수만 판단함 -> 실패
  • 첫 자리 수가 5인 경우 그 다음 자리 수가 5를 넘을지 안 넘을지도 판단해야 함

📌 핵심 아이디어

  • 5를 기준으로 빼는 게 나을지 더하는 게 나을지 판단함

⏳ 시간 복잡도

  • O(logn)

✅ 실행 결과

image

💡 기타 참고 사항

  • 재귀 가능
  • DP 방식 가능

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.

1 participant