Your question is Max Sum of Non-Adjacent Elements. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
A Quora Feed ranking experiment assigns an integer score to each candidate item. Given an array of scores, choose a subset of items with no two selected items adjacent, maximizing the total score. You may choose no items, so the result is 0 when every score is negative.
Implement a function that accepts nums, a list of integers, and returns an integer representing the maximum possible sum of non-adjacent elements. Adjacent means consecutive positions in the original array. You do not need to return the selected indices.
def max_non_adjacent_sum(nums):