Pergunta de entrevista da empresa OYO

Maximum sum such that no two elements are adjacent