-
leetcode.com/problems/house-robber/
House Robber - 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
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically contact the police if two adjacent houses were broken into on the same night.
Given a list of non-negative integers representing the amount of money of each house, determine the maximum amount of money you can rob tonight without alerting the police.
이 문제가 생각났다. 그렇다 동적 프로그래밍이다.
2020/05/29 - [2020년 상반기/코테] - [코테 연습] 포도주 시식 Python
[코테 연습] 포도주 시식 Python
문제 효주는 포도주 시식회에 갔다. 그 곳에 갔더니, 테이블 위에 다양한 포도주가 들어있는 포도주 잔이 일렬로 놓여 있었다. 효주는 포도주 시식을 하려고 하는데, 여기에는 다음과 같은 두 가
weejw.tistory.com
바로 직전 집을 도둑질한다. + 지금 집을 도둑질하지 않는다.
바로 직전 집을 도둑질하지 않는다. + 지금 집을 도둑질한다.
중 더 큰 값을 취한다.
'2020년 > 코테' 카테고리의 다른 글
[코테 연습] 구명 보트 (0) 2020.09.15 [코테 연습] Length of Last Word (0) 2020.09.15 [코테 연습] 가장 큰수 (0) 2020.09.15 [코테 연습] Bulls and Cows (0) 2020.09.14 [코테연습] Combination Sum III (0) 2020.09.14