you professional robber planning rob house street each house certain money stash constraint stop robbing adjacent house security system connect automatically contact police adjacent house break nightgiven integer array num represent money house return maximum money rob tonight alert police Example 1input num 1231output 4explanation Rob house 1 money 1 rob house 3 money 3total rob 1 3 4example 2input num 27931output 12explanation Rob house 1 money 2 rob house 3 money 9 rob house 5 money 1total rob 2 9 1 12 constraints1 numslength 1000 numsi 400