This problem is very similiar to House Robber, such that we can not choose both of the first item and the last item.
The idea is to iterate the array two times, once we eliminate the first item, the other time we eliminate the lst item.
This problem is very similiar to House Robber, such that we can not choose both of the first item and the last item.
The idea is to iterate the array two times, once we eliminate the first item, the other time we eliminate the lst item.