Tell me about a time you worked through a dynamic programming problem to reach the solution.
For the hands-on portion, implement the dynamic programming solution below. Given an integer array, return the maximum sum of elements such that no two selected elements are adjacent. Implement def max_non_adjacent_sum(nums):; return an integer, and return 0 for an empty array.
def max_non_adjacent_sum(nums):