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.
total = 1로 두고..
경우1) 리스트의 맨 첫 번째 요소는 무조건 경우의 수를 곱해주고
경우2) 두번째 요소부터 이전 요소랑 비교를 한다. 두 개가 같다면 경우의 수 - 1을 곱한다
경우3) 아니면 그냥 경우의 수를 곱한다.
정말 개같은 점은 합계를 항상 10000000009로 나눠서 초기화 하지 않으면 시간초과가 난다는 점이다.
시간복잡도는 똑같이 O(N)인데 메모리 초과도 아니고 시간 초과가 나는 덕분에 실버5 문제 가지고 거의 두 시간을 개삽질한 게 너무 억울