package leetcode;

import java.util.Arrays;

/**
 * https://leetcode.com/problems/distribute-candies-to-people/
 */
public class Problem1103 {
    public int[] distributeCandies(int candies, int num_people) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1103 prob = new Problem1103();
        System.out.println(Arrays.toString(prob.distributeCandies(7, 4))); // [1,2,3,1]
        System.out.println(Arrays.toString(prob.distributeCandies(10, 3))); // [5,2,3]
    }
}

@@ -16,34 +16,8 @@
 e;%0A%0A
-import java.util.Arrays;%0A%0A
 /**%0A
@@ -188,85 +188,90 @@
     
-// TODO%0A        return null
+int%5B%5D answer = new int%5Bnum_people%5D;%0A        int i = 0
 ;%0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args
+while (candies %3E= 0
 ) %7B%0A
@@ -282,220 +282,295 @@
     
+  
-Problem1103 prob = new Problem1103();%0A        System.out.println(Arrays.toString(prob.distributeCandies(7, 4))); // %5B1,2,3,1%5D%0A        System.out.println(Arrays.toString(prob.distributeCandies(10, 3))); // %5B5,2,3%5D
+  int index = i %25 num_people;%0A            int val = i + 1;%0A            if (val %3C= candies) %7B%0A                answer%5Bindex%5D += val;%0A            %7D else %7B%0A                answer%5Bindex%5D += candies;%0A            %7D%0A            candies -= val;%0A            i++;%0A        %7D%0A        return answer;
 %0A   

Solve problem 1103