Pergunta de entrevista da empresa Apple

Design an algorithm to find the maximum sum of non-adjacent elements in an array.