[BOJ] 1449. 수리공 항승 #45
Open
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.
구현 방법
4-1. 현재 위치에서 하나의 테이프를 사용한 길이(L)를 더하고 0.5 간격을 빼줍니다. 이를 end에 할당합니다.
4-2. 테이프를 한 번 사용했으니
result++
합니다.4-3. 인덱스를 +1 옮겨요.
4-4.
if
조건문 다음 인덱스가 end보다 작은 경우 이전 테이프로 물 새는 곳을 막았기 때문에 넘어갑니다.시간 복잡도
Number()
래퍼 객체로 변환할 때 시간이 적게 들어요.참고
https://github.com/ndb796/BOJ_JavaScript/blob/main/solutions/1449.js