Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
If a row has k triangles, how many cards does it take to build that row? It takes 3 * k - 1 cards.
If you still have i cards left, and on the previous row there were k triangles, what are the possible ways to build the current row? You can start at 1 triangle and continue adding more until you run out of cards or reach k - 1 triangles.