Tiling a Rectangle with the Fewest Squares

Given an n x m rectangle, return the minimum number of squares needed to tile it. You can use squares of any size.

Examples
Input: [2,3]
Output: 3
Hints

Tiling a Rectangle with the Fewest Squares

Given an n x m rectangle, return the minimum number of squares needed to tile it. You can use squares of any size.