谷歌Onsite新题

Given a rectangle with height and width, find the minimum number of integer-sided squares that tile the rectangle.

Example 1:

Input: height = 11, width = 13
Output: 6
Explanation:

image

Example 2:

Input: height = 4, width = 5
Output: 5
Explanation:

image

Example 3:

Input: height = 36, width = 30
Output: 5
Explanation:

image

More examples

有点难。。

有点难度 感谢分享!