https://leetcode.com/problems/word-break/
맨처음에 완전탐색으로 열심히 풀었는데, 타임 초과가 걸렸다.
킹받드라슈 ~
그래서 찾아보니 DP로 풀면 되는 문제더라.
매우 친절하게 설명해놓으신 분 링크
https://dev-note-97.tistory.com/274
위에분은 javascript로 풀으셔서, slice 등의 사용법이 달랐으니 주의.
코드짜는게 은근 생각할게많아서 조금 시간이 걸렸다.
꼭 다시 복습해봐야지.
'Algorithm Study' 카테고리의 다른 글
[leetcode ] 93. Restore IP Addresses / 백트래킹 / JAVA (다시) (0) | 2022.09.16 |
---|---|
[leetcode] 1375. Number of Times Binary String Is Prefix-Aligned (0) | 2022.09.16 |
[leetcode] 200. Number of islands (medium) (0) | 2022.09.13 |
[leetcode] 78. Subsets (medium) (0) | 2022.09.13 |
[leetcode] Array- Merge Sorted Array (1) | 2022.09.11 |