Pregunta de entrevista de Databricks

Max sum in array, but without choosing neighbours elements.