Coin Path




Why second approach has O(n^2) time complexity instead of O(nB)? It looks to me that for every node you try at most B possible locations to jump at, which should yield to O(nB) time complexity. And also I think DP and recursive+memorization should have the same time complexity, these two are different ways of coding, in my opinion. Please correct me if I'm wrong.
