-
-
Notifications
You must be signed in to change notification settings - Fork 195
[김한기] - Week 4 solutions #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
그러네요! 수정할게요 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다! 복잡도 분석도 추가해주시면 코드 리뷰에 도움이 될 것 같습니다.
# @param {Integer} n, a positive integer | ||
# @return {Integer} | ||
def reverse_bits(n) | ||
# 이유는 모르겠으나 문제 설명과는 달리 leetcode 루비 테스트코드에선 n이 10진수 Integer로 들어오네요. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
다른 언어에서도 마찬가지에요. 문제가 좀 오해가 소지가 있게 설명이 되어 있는 것 같아요 😅
Enum.map(0..n, fn i -> | ||
Integer.digits(i, 2) |> Enum.count(&(&1 != 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
시간 복잡도가
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 사실 시간복잡도 공간복잡도 개념이 익숙치 않은데 공부해야겠네요 ^^;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코딩 인터뷰에서 시공간 복잡도 분석이 필요한 걸로 알고 있는데 맞을까요?
defmodule Solution do | ||
@spec missing_number(nums :: [integer]) :: integer | ||
def missing_number(nums) do | ||
(0..length(nums) |> Enum.to_list) -- nums |> Enum.at(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
신기한 연산자가 많네요. 언어별 특징이 보이는 것 같아 보는 맛이 있네요 ㅎㅎ
No description provided.