Home > Data Structures and Algorithms 🚀 > Dynamic Programming Interview Questions > How Does DP Work? Dynamic Programming Tutorial Show previous contentBut if we have 2 houses it becomes a little more interesting. But it's still pretty simple. If house A has more money, we rob house A. But if house B has more money we rob house B.cppgojavajavascriptpython1if (len === 2) return Math.max(nums[0], nums[1]); Show following content