Algorithm Study

[leetcode] 139. word break (medium) / JAVA / DP

hyun-1200 2022. 9. 13. 23:43

https://leetcode.com/problems/word-break/

 

Word Break - LeetCode

Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

leetcode.com

 

맨처음에 완전탐색으로 열심히 풀었는데, 타임 초과가 걸렸다.

킹받드라슈 ~ 

 

 

 

그래서 찾아보니 DP로 풀면 되는 문제더라.

 

매우 친절하게 설명해놓으신 분 링크 

https://dev-note-97.tistory.com/274

 

[리트코드] 139. Word Break / Javascript

문제주소 :https://leetcode.com/problems/word-break/ Word Break - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for you..

dev-note-97.tistory.com

 

 

위에분은 javascript로 풀으셔서, slice 등의 사용법이 달랐으니 주의.

코드짜는게 은근 생각할게많아서 조금 시간이 걸렸다.

 

꼭 다시 복습해봐야지.