Hiring process8 levels
  1. 1 IQ Test
  2. 2 Additional Online Test (If Required)
  3. 3 Office Interview with Hiring Manager
  4. 4 Unpaid Test Task (Motivation Check)
  5. 5 Paid Test Task and Follow-Up Interview
  6. 6 Iterative Paid Test Tasks
  7. 7 Office Verification
  8. 8 Final Interview with the Founder

Problems > Tiling 2xN with Dominoes and L-Trominoes > Editorial

Tiling 2xN with Dominoes and L-Trominoes — Solution & Editorial

Back to the Problem

Model the count as a linear state transition (a fixed matrix acting on the current state vector) and raise the matrix to the N-th power in O(log N).

Complexity: O(log N)

Watch out: Two coupled sequences (with/without a protruding cell) must be tracked together.