Maximum-Sum Simple Path in a Small Grid

Asked at Goldman Sachs · Coding Questions · Difficulty: Medium · Last asked Nov 15, 2024

You are given a small grid of integers, some of them negative. Choose a walk that starts on any cell, moves between side-adjacent cells, and never steps on the same cell twice. Return the largest total of the values on the cells the walk visits.

Loading the problem…