파이썬 DP 4

[Python] 리트코드 403. Frog Jump (Array, DP)

https://leetcode.com/problems/frog-jump/ Frog Jump - 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 개구리가 강을 건너는데 그 강은 몇 개의 유닛으로 쪼개져 있다. 각 유닛엔 돌이 있을 수도 있고 없을 수도 있다. 오름차순 리스트인 stones가 주어질 때 개구리가 맨 끝까지 갈 수 있다면 true를 반환한다. 맨 처음에는 1칸을 뛸 수 있으며 개구리가 마지막에 k유닛을 점프했다면 다음에 점프할 수 있는 유닛의 간격은 k..

알고리즘 2021.09.10

[Python] 리트코드 216. Combination Sum III

https://leetcode.com/problems/combination-sum-iii/ Combination Sum III - 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 ==문제== 1~9까지의 숫자를 k개 사용해서 n이 되는 조합을 찾는 문제이다. 각 숫자는 한 번씩만 사용할 수 있고 모든 조합 경우의 수를 리턴하면 된다. 이 문제는 전에 풀었던 문제가 한단계 업그레이드 된 버전이다. ▼풀이 2021.07.12 - [알고리즘] - [Python] 리트코..

알고리즘 2021.09.02

[Python] 리트코드 983 : Minimum Cost For Tickets (DP)

https://leetcode.com/problems/minimum-cost-for-tickets/submissions/ Minimum Cost For Tickets - 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 ==문제== days에 365일 중에 어떤 날짜에 여행할지 저장되어있다. 여행 티켓은 1일권, 7일권, 30일권 세 종류가 있는데 이 가격 정보는 costs에 차례로 들어있다. 어떤 날짜에 며칠권을 사야 가장 적은 돈으로 여행을 할 수 있는지 묻는 ..

알고리즘 2021.06.18

[Python] 리트코드 877 : Stone Game (DP)

https://leetcode.com/problems/stone-game/submissions/ Stone Game - 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 짝수개의 돌무더기가 있을 때 Alex와 Lee가 한 무더기씩 번갈아가면서 가져갈 것이다. 양쪽 끝에 있는 돌무더기만 가져갈 수 있을 때 Alex가 이길 수 있으면 True를 반환한다. piles의 첫 번째를 piles[i]라고 하고 끝을 piles[j]라고 할 때 piles[i, i+1, i+2, ..

알고리즘 2021.06.16