+1 vote
Tetris is known to be NP-complete problem in general.  However, in this constrained version, we only consider the straight tetrominoes, and further, we cannot rotate them.

We can make the general assumptions that the board is w x h (width x height).  We can see the entire sequence of tetrominoes, which is n units long and only consists of straight tetrominoes (horizontal or vertical).  We can place those tetrominoes wherever we like, but we cannot rotate them.

We receive k points for each row that becomes full.  The full row is then cleared away.

​We need to maximize the score before the height reaches h (not including the cleared rows).
in Graph Theory by AlgoMeister (1.6k points)
retagged by

1 Answer

0 votes
The easiest way I think of is the exhaustive method. Do it with a matrix. It should be polynomial time. I cannot find a method to quickly make sure it is optimal without exhaustive method because the result seems to change time by time. I am not sure but constrained version seems do not change the time complicity? It only adds 4 possibilities.
by AlgoMeister (964 points)

Related questions

+2 votes
2 answers
asked Mar 3, 2018 in Dynamic Programming by jmlitfi AlgoMeister (684 points)
+1 vote
3 answers
0 votes
3 answers
The Book: Analysis and Design of Algorithms | Presentations on Slideshare | Lecture Notes, etc
...