Transform [mp]
Micro pattern¶
Description¶
Express a complex operation as a sequence of simpler transformations.
Problems¶
Rotation from reversals¶
Reverse a complete array and its two partitions to rotate it.
- 189. Rotate Array (Top Easy)
Rotation from transpose and reversal¶
Transpose a square matrix before reversing its rows.
- 48. Rotate Image (Top Easy)
Transform an unprotected complement¶
Identify protected states, transform the rest, and restore protected markers where necessary.
- 130. Surrounded Regions (Top Hard)
- 1020. Number of Enclaves (Graph Theory)
- 1254. Number of Closed Islands (Graph Theory)
Encode then expose a new state¶
Store a next state beside its original state before discarding the original representation.
- 289. Game of Life (Top Hard)
Reduce to a familiar recurrence¶
Aggregate or reorder input so a known transition applies to transformed states.
- 740. Delete and Earn (Dynamic Programming)
- 354. Russian Doll Envelopes (Dynamic Programming)