Problem 213 · Medium

House Robber II

Run the linear house robber DP twice: once excluding the first house, once excluding the last; take the max.

Open the interactive visualisation