Agoda·Software Engineer·Technical Phone Screen
- Given a triangle represented as a 2D array, find the minimum path sum from the top to the bottom row, where at each step you can only move to an adjacent number in the row below.
“My first instinct was top-down recursion with memoization which works fine, but the cleaner solution is bottom-up DP starting from the second-to-last row and working upward.”