Goldman Sachs Interview Question

In coderpad round I was asked two questions. One question was based on 2D Dynamic programming and the other on Heaps/Priority Queue