@@ -0,0 +1,1663 @@
+import java.util.Arrays;%0A%0Apublic class Solution %7B%0A%0A  public int solution(int number) %7B%0A    boolean%5B%5D ans = new boolean%5Bnumber + 5%5D;%0A    for(int i = 3; i %3C number; i+=3)%7B%0A      ans%5Bi%5D = true;%0A    %7D%0A    for(int i = 5; i %3C number; i+=5)%7B%0A      ans%5Bi%5D = true;%0A    %7D%0A    int sum = 0;%0A    for (int i=3; i %3C number; i++)%7B%0A      if (ans%5Bi%5D)%0A        sum += i;%0A    %7D%0A    return sum;%0A  %7D%0A%7D%0A%0Apublic class Solution %7B%0A%0A  public int solution(int number) %7B%0A    int sum=0;%0A    %0A    for (int i=0; i %3C number; i++)%7B%0A      if (i%253==0 %7C%7C i%255==0)%7Bsum+=i;%7D%0A    %7D%0A    return sum;%0A  %7D%0A%7D%0A%0Aimport java.util.stream.IntStream;%0A%0Apublic class Solution %7B%0A  public int solution(int number) %7B%0A    return IntStream.range(0, number)%0A                    .filter(n -%3E (n %25 3 == 0) %7C%7C (n %25 5 == 0))%0A                    .sum();%0A  %7D%0A%7D%0A%0A/*%0A    The sum of multiples of 3 is 3 + 6 + 9 + ... = 3 (1+2+3+...)%0A    The sum of mulitples of 5 is 5 + 10 + 15 + ... = 5 (1+2+3+...)%0A    If we just sum these, we'll get double values when a number is divisble by both,%0A    so we substract the sum of multiples of 15, which is obtained in a similar manner.%0A    The upper bound cannot be floor function because the inputed number shouldn't count.%0A*/%0A%0Aimport java.lang.Math;%0Apublic class Solution %7B%0A  public int solution(int n) %7B%0A    int a = (int) Math.ceil(n/3d) - 1;%0A    int b = (int) Math.ceil(n/5d) - 1;%0A    int c = (int) Math.ceil(n/15d) - 1;%0A    return (3 * a * (a+1) + 5 * b * (b+1) - 15 * c * (c + 1)) / 2;%0A  %7D%0A%7D%0A%0Aimport org.junit.Test;%0Aimport static org.junit.Assert.assertEquals;%0A%0Apublic class SolutionTest %7B%0A    @Test%0A    public void test() %7B%0A      assertEquals(23, new Solution().solution(10));%0A    %7D%0A    %0A%7D%0A

Create Multiples_of_3_or_5.java