Domanda di colloquio di Databricks

Max sum in array, but without choosing neighbours elements.