Adobe interview question

Based on matrix, linkedlist and dp.