One Line JS | super simple
create a array and than store each value according to the 2*i + 1\n2. now each element of the array should be brought to "n" in order to achieve equality (study
1. create a array and than store each value according to the 2*i + 1\n2. now each element of the array should be brought to "n" in order to achieve equality (study the pattern)\n3. after that we know in each operation there is both decrement and increment. \nTherefore we only consider either of the cases required and return the sum.\n\n```\nconst minOperations = n => Array(n).fill(0).map((e,i)=> 2*i + 1).reduce((a,e)=> e<n ? a+=(n-e):a, 0)\n```
[]