一.原题
链接:Training on Progressive Spiral Number Position | Codewars
Assume that you started to store items in progressively expanding square location, like this for the first 9 numbers: |
二、解题
1、分析
(1)数字必须存入点组成的正方形中。
(2) 5个数字可用3X3存放,6个必须用4X4。可用下面印证