InstacartSoftware Engineer · Technical ScreenCodemia practiceDynamic Programming on array
Given an array of integers, implement a dynamic programming solution to find the maximum sum of non-adjacent elements. You should return the maximum sum that can be obtained without selecting two adjacent numbers from the array. For example, given the input array [3, 2, 5, 10, 7], the output should be 15, as selecting 3, 10, and 2 yields the highest sum without selecting adjacent elements.
Medium
Coding & Algorithms