Consider a Cartesian grid, with verteces at integer x and y values, where every four vertices around a vacant space define a unit square. An Aztec Diamond of order d is the shape formed by all unit squares whose centers satisfy the equation:
abs(x) + abs(y) <= d
Given the order of an Aztec Diamond, d (positive integer), return the number, n, of possible tilings using domino tiles, i.e. rectangles sized 1x2 and 2x1, such that:
- The entire shape is covered
- There are no overlapping tiles
- None of the tiles stick out of the shape
Example:
An Aztec Diamond of order 4 is shown at this URL.
Input: d = 4
Output: n = 1024
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers16
Suggested Problems
-
Number of 1s in the Binary Representation of a Number
486 Solvers
-
248 Solvers
-
Create Volcano (or Atoll) martix. It is an extension of Bullseye matrix problem.
162 Solvers
-
It's going down. We're finding simbers!
89 Solvers
-
Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
961 Solvers
More from this Author45
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!