package com.fishercoder.solutions;

public class _1551 {
    public static class Solution1 {
        public int minOperations(int n) {
            int min = 1;
            int max = 2 * (n - 1) + 1;
            int finalNumber = (max + min) / 2;
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = 2 * i + 1;
            }
            int ops = 0;
            for (int i = 0; i < n / 2; i++) {
                ops += finalNumber - arr[i];
            }
            return ops;
        }
    }
}

@@ -243,136 +243,8 @@
  2;%0A
-            int%5B%5D arr = new int%5Bn%5D;%0A            for (int i = 0; i %3C n; i++) %7B%0A                arr%5Bi%5D = 2 * i + 1;%0A            %7D%0A
     
@@ -351,14 +351,19 @@
 r - 
-arr%5Bi%5D
+(2 * i + 1)
 ;%0A  

refactor 1551