Solution Minimum Moves to Make Array Complementary
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public $s = array();\n\n    public function __construct() {\n        $this->s = array_fill(0, 200002, 0);\n    }\n\n    public function minMoves($nums, $limit) {\n        $n = count($nums);\n        $reach = 0;\n\n        for ($i = 0; $i < $n / 2; $i++) {\n            $small = min($nums[$i], $nums[$n - 1 - $i]);\n            $big = max($nums[$i], $nums[$n - 1 - $i]);\n            $reach = max($reach, $small + $big);\n\n            $this->s[1] += 2;\n            $this->s[$small + 1]--;\n            $this->s[$small + $big]--;\n            $this->s[$small + $big + 1]++;\n            $this->s[$big + $limit + 1]++;\n        }\n\n        $reach = max($reach, $limit * 2);\n        $ans = PHP_INT_MAX;\n\n        for ($i = 2; $i <= $reach; $i++) {\n            $this->s[$i] += $this->s[$i - 1];\n            $ans = min($ans, $this->s[$i]);\n        }\n\n        return $ans;\n    }\n}\n\n```
['PHP']