Hexagonal Grid Discussions | Algorithms | HackerRank
  • + 1 comment

    The solution was very simple. The problem I had was visualising the problem. It's not two strings/arrays that are one under the other, but a single stream of places in a snake-like arrangement. Once you realize that, the "DP" problem is keeping track of how many spaces and how many blocks there have been. O(n)