https://leetcode-cn.com/problems/house-robber-ii/ //rob 0, not rob n-1 || not rob 0,not rob n-1 ==>rob(0,nums.length-2,nums) //not rob 0,rob n-1 || not rob 0,not rob n-1;==>rob(1, nums.length-1, nums) func rob(nums []int) int { n := len(nums) if n =…