belita76   4년 전

이 문제를 풀때의 로직은 같은데, 라이브러리를 불러오느냐, 그렇지 않느냐에 따라 시간초과여부가 달라집니다. 

이유가 뭔지 몰라서 여쭤봅니다. 

미리 감사드립니다~

shg9411   4년 전

제가 알기로 arraylist는 내부적으로 배열을 사용하기에 삭제시에 쉬프트하는데에 시간이 더 걸리는 것으로 알고 있습니다.

shg9411   4년 전

The List api states

Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

댓글을 작성하려면 로그인해야 합니다.