Cisco interview question

Leetcode house robber, easy dynamic programming