java.lang.Object
g1201_1300.s1240_tiling_a_rectangle_with_the_fewest_squares.Solution

public class Solution extends Object
1240 - Tiling a Rectangle with the Fewest Squares.<p>Hard</p> <p>Given a rectangle of size <code>n</code> x <code>m</code>, return <em>the minimum number of integer-sided squares that tile the rectangle</em>.</p> <p><strong>Example 1:</strong></p> <p><img src="https://assets.leetcode.com/uploads/2019/10/17/sample_11_1592.png" alt="" /></p> <p><strong>Input:</strong> n = 2, m = 3</p> <p><strong>Output:</strong> 3</p> <p><strong>Explanation:</strong> <code>3</code> squares are necessary to cover the rectangle.</p> <p><code>2</code> (squares of <code>1x1</code>)</p> <p><code>1</code> (square of <code>2x2</code>)</p> <p><strong>Example 2:</strong></p> <p><img src="https://assets.leetcode.com/uploads/2019/10/17/sample_22_1592.png" alt="" /></p> <p><strong>Input:</strong> n = 5, m = 8</p> <p><strong>Output:</strong> 5</p> <p><strong>Example 3:</strong></p> <p><img src="https://assets.leetcode.com/uploads/2019/10/17/sample_33_1592.png" alt="" /></p> <p><strong>Input:</strong> n = 11, m = 13</p> <p><strong>Output:</strong> 6</p> <p><strong>Constraints:</strong></p> <ul> <li><code>1 <= n, m <= 13</code></li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • tilingRectangle

      public int tilingRectangle(int n, int m)