package leetcode;

import java.util.Arrays;

/**
 * https://leetcode.com/problems/statistics-from-a-large-sample/
 */
public class Problem1093 {
    public double[] sampleStats(int[] count) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1093 prob = new Problem1093();
        System.out.println(Arrays.toString(prob.sampleStats(new int[]{
            0,1,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}))); // [1.00000,3.00000,2.37500,2.50000,3.00000]
        System.out.println(Arrays.toString(prob.sampleStats(new int[]{
            0,4,3,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}))); // [1.00000,4.00000,2.18182,2.00000,1.00000]
    }
}

@@ -197,35 +197,692 @@
     
-// TODO%0A        return null
+int min = Integer.MAX_VALUE;%0A        int max = Integer.MIN_VALUE;%0A        int size = 0;%0A        int sum = 0;%0A        int modeCount = Integer.MIN_VALUE;%0A        int mode = 0;%0A        for (int i = 0; i %3C count.length; i++) %7B%0A            sum += i * count%5Bi%5D;%0A            size += count%5Bi%5D;%0A            if (count%5Bi%5D %3E 0) %7B%0A                min = Math.min(min, i);%0A                max = Math.max(max, i);%0A            %7D%0A            if (modeCount %3C count%5Bi%5D) %7B%0A                mode = i;%0A                modeCount = count%5Bi%5D;%0A            %7D%0A        %7D%0A        double mean = (double) sum / (double) size;%0A        double median = 0; // TODO%0A        return new double%5B%5D%7Bmin, max, mean, median, mode%7D
 ;%0A  

Update problem 1093