### Random Post

### Recent Posts

- Enigma 415: Buses galore
- Puzzle 65: Division: figures all wrong
- Enigma 1097: Chessboard triangles
- Enigma 414: Nicely bungled, Sir!
- Tantalizer 473: Pigeon post
- Enigma 1098: Soccer heroes
- Enigma 413: Quargerly dues
- Puzzle 66: Hopes and successes on the island
- Enigma 1099: Unconnected cubes
- Enigma 412: A triangular square

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,106)
- misc (2)
- project euler (2)
- puzzle (27)
- site news (43)
- tantalizer (27)
- teaser (3)

### Site Stats

- 164,322 hits

The following Python code runs in 32ms.

Solution:The first polygon has 9 sides. The second polygon polygon has 40 sides.I know it hardly matters in such a small case as this, but once you’ve determined X, you don’t need a loop to determine Y. As XY = 360 you can do it much more efficiently in one step:

Thanks for the hint.

By using divmod, 0.0003793778259527398 seconds process time,

reduced to 0.00030953654724273616 seconds process time, without Y loop.