Ejemplo n.º 1
0
        public string Part1(string[] input)
        {
            var value    = int.Parse(input[0]);
            var sideSize = Convert.ToInt32(Math.Ceiling(Math.Sqrt(value))) + 1;
            var spiral   = new Spiral(sideSize % 2 == 0 ? sideSize + 1 : sideSize);

            return(spiral.FindDistance(value).ToString());
        }