Consider this test case --> k = 3 n = 3

dp[3] = dp[3-1] + dp[3-3],

= 1

```
This what your code would do...
```

While the answer is 2 ( using all vertical or using all horizontal tiles)

So what you’re missing is, when k = 3, we can actually tile the upper row or lower row first and now what we’ve is identical to k = 2.

Thus the one more statement to add would be

```
If upper & bottom rows are tileable by horizontal tiles i.e. n divisible by 3 & k==3.
dp[3, i ] += 2*dp[ 2, i ] - 1,
subtracted 1 so that we don't count the way when we use only horizontal tiles t
twice because they're alike as in the example above.
.
```

Well, that’s it I guess… I haven’t solved it yet or seen before it, so can’t say if anything else is missing ( although I am highly confident that everything else is fine) but for sure this was something that was missing…

Let me know if it helps or if something wasn’t clear.

Cheers!