Maximize sum without choosing adjacent elements | Google Interview Question