Question d’entretien chez Amazon

Maximum sum subarray such that no elements are consecutive