package leetcode;

/**
 * https://leetcode.com/problems/sum-of-mutated-array-closest-to-target/
 */
public class Problem1300 {
    public int findBestValue(int[] arr, int target) {
        // TODO
        return 0;
    }

    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
    }
}

@@ -186,15 +186,182 @@
     
-// TODO
+int max = 0;%0A        int sum = 0;%0A        for (int num : arr) %7B%0A            sum += num;%0A            max = Math.max(max, num);%0A        %7D%0A        int answer = sum / arr.length;
 %0A   
@@ -372,17 +372,22 @@
  return 
-0
+answer
 ;%0A    %7D%0A
@@ -734,16 +734,169 @@
 / 11361%0A
+        System.out.println(prob.findBestValue(new int%5B%5D%7B10,10,10%7D, 10)); // 3%0A        System.out.println(prob.findBestValue(new int%5B%5D%7B1,1,1%7D, 10)); // 1%0A
     %7D%0A%7D%0A

Update problem 1300