Skip to content

홍성우_Power of Three#45

Open
hsw824 wants to merge 2 commits intomainfrom
hsw2
Open

홍성우_Power of Three#45
hsw824 wants to merge 2 commits intomainfrom
hsw2

Conversation

@hsw824
Copy link
Copy Markdown

@hsw824 hsw824 commented Aug 6, 2025

🧑‍💻 언어 및 제출 결과

  • 사용 언어: TypeScript
  • 통과 여부: ❌

🧠 풀이 설명

  • while을 통해 계속 3에 계속 3을 곱하는 방식으로 비교를 시도함
function isPowerOfThree(n: number): boolean {
    if(n === 0) return false
    if( n === 1) return true


      let powered = 3;
    while (powered < n) {
        powered = powered * 3;
    }

  return powered === n;
}

📊 시간/공간 복잡도

✅ 어떠한 근거로 시간/공간 복잡도가 이렇게 나왔는지 설명해주세요.

⚡️ 풀이의 속도와 메모리 등을 캡쳐해서 올려주세요.

  • 시간 복잡도: O(n)
  • 공간 복잡도: O(1)

📝 추가 설명 (선택)

  • 고민했던 포인트가 있다면 간단히 적어주세요.

🙋‍♂️ 리뷰어에게

  • 리뷰어가 보면 좋을 포인트, 질문, 궁금한 점 등을 작성해 주세요.

@github-actions github-actions bot added the TeamB Team label for TeamB label Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TeamB Team label for TeamB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant