Note: This is an extension of House Robber.
After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This time, all houses at this place are arranged in a circle. That means the first house is the neighbor of the last one. Meanwhile, the security system for these houses remain the same as for those in the previous street.
Given a list of non-negative integers representing the amount of money of each house, determine the maximum amount of money you can rob tonightwithout alerting the police.
原文链接http://blog.youkuaiyun.com/crazy__chen/article/details/46580553
本文介绍了一种解决环形排列房屋中最大金额抢劫问题的算法。该算法通过避免同时抢劫相邻房屋来防止报警,利用动态规划思想实现,分为两部分进行计算:一部分忽略首间房屋,另一部分忽略末间房屋。
439

被折叠的 条评论
为什么被折叠?



