Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Day-20 / 박종은
문제 번호
(Optional) 공유하고 싶은 내용
355_DesignTwitter
시간을 많이 날린 정말 킹받는 문제다. 물론 내 경험 부족 탓이다.$3 * 10^4$ 번 호출 될 것이라 했다.$10^4$ 개이므로 최종적으로 $3 * 10^4 * 10^4$ 번 호출되어서 우리가 흔히 생각하는 time limit 인 $10^8$ (약 1초) 을 초과하게 된다. 그래서 나는 무조건 O($logn$ ) 의 알고리즘을 써야된다고 생각했다. 그러나 정작 solution 은 O(n) 이였다.
문제는 해당 함수가
worst case 를 고려했을 때 주어진 tweet 의 최대 개수는
이미 생각했던 솔루션이지만 당연히 안될 줄 알고 건너뛴 것이다. 너무 time complexity 에 얽매이지 않고 더 나은 solution 이 도저히 생각안나면 최선의 solution 으로 돌려봐야겠다.
17_LetterCombinationsofaPhoneNumber
c++ 에서 string 에 array 처럼
pop_back()
과push_back()
을 할 수 있다는 사실을 처음 알았다. 나는 아직 잼민이구나