package leetcode;

/**
 * https://leetcode.com/problems/sum-of-mutated-array-closest-to-target/
 */
public class Problem1300 {
    public int findBestValue(int[] arr, int target) {
        int max = 0;
        int sum = 0;
        for (int num : arr) {
            sum += num;
            max = Math.max(max, num);
        }
        int answer = sum / arr.length;
        return answer;
    }

    public static void main(String[] args) {
        Problem1300 prob = new Problem1300();
        System.out.println(prob.findBestValue(new int[]{4,9,3}, 10)); // 3
        System.out.println(prob.findBestValue(new int[]{2,3,5}, 10)); // 5
        System.out.println(prob.findBestValue(new int[]{60864,25176,27249,21296,20204}, 56803)); // 11361
        System.out.println(prob.findBestValue(new int[]{10,10,10}, 10)); // 3
        System.out.println(prob.findBestValue(new int[]{1,1,1}, 10)); // 1
        System.out.println(prob.findBestValue(new int[]{1,2,1}, 10)); // 2
    }
}

@@ -478,16 +478,18 @@
 1300();%0A
+//
         
@@ -547,32 +547,34 @@
 ,3%7D, 10)); // 3%0A
+//
         System.o
@@ -632,16 +632,18 @@
 ); // 5%0A
+//
         
@@ -740,16 +740,18 @@
 / 11361%0A
+//
         
@@ -820,16 +820,18 @@
 ); // 3%0A
+//
         
@@ -897,16 +897,18 @@
 ); // 1%0A
+//
         
@@ -974,16 +974,90 @@
 ); // 2%0A
+        System.out.println(prob.findBestValue(new int%5B%5D%7B1,2,3%7D, 7)); // 3%0A
     %7D%0A%7D%0A

Update problem 1300