tiles identical square tiles and must lay all of them out as one solid rectangle. You want it as close to a square as possible, so the difference between its length and width should be as small as it can be.
Return [length, width] in tiles, with length ≥ width.tiles=24 → [6, 4]
The options are 24×1, 12×2, 8×3 and 6×4. The sides of 6×4 are the closest.
tiles=49 → [7, 7]
49 = 7×7, a perfect square.
tiles=13 → [13, 1]
13 is prime, so the only option is a 13×1 strip.
tiles=24
[6, 4]
Run checks the first 3 tests in your browser. Submit checks all 62 tests on the server, hidden ones included.