✅ C++✅C# ✅ JavaScript.The shortest solutions are there.
Intuition:\n\nif you think of the array as points forming a line on a graph, then you can think of that line as the diagonal of a box of area n * 2n, or 2n^2. I
# Intuition:\n![image.png](https://assets.leetcode.com/users/images/e4fd3842-9330-463c-8df3-515cc90ecec4_1683274258.4139304.png)\nif you think of the array as points forming a line on a graph, then you can think of that line as the diagonal of a box of area n * 2n, or 2n^2. If you then think of the triangle of moves that have to be made, you can note that the area of said triangle is 1/8th the area of the box, or 2n^2 / 8, or n^2 / 4\n<!-- Describe your first thoughts on how to solve this problem. -->\n![photo_2023-05-05_13-11-09.jpg](https://assets.leetcode.com/users/images/1fc87bfb-99bb-4b34-b4f9-796f2c51769b_1683274417.5123234.jpeg)\n\n```javascript []\nvar minOperations = (n) =>n*n/4; \n```\n```C++ []\nclass Solution {\npublic:\n    int minOperations(int n) {\n       return n*n/4; \n    }\n};\n```\n```C# []\npublic class Solution {\n\n    public int MinOperations(int n) => n*n/4;\n\n}\n```\n\n![Vote.png](https://assets.leetcode.com/users/images/b1b63813-16ae-4cea-8923-121576c1b7fb_1683274036.8745968.png)\n\n
['C++', 'JavaScript', 'C#']