// Project Euler problem 33
public class Problem033 {
    public static void main(String[] args) {
        System.out.println();
    }
}

@@ -1,8 +1,63 @@
+import java.util.ArrayList;%0Aimport java.util.HashSet;%0A%0A
 // Proje
@@ -76,16 +76,40 @@
 blem 33%0A
+// Solved on 12/16/2016%0A
 public c
@@ -171,16 +171,2301 @@
 args) %7B%0A
+        // numerator and denominator products of the valid fractions%0A        int nCombined = 1;%0A        int dCombined = 1;%0A        %0A        // loop through valid fractions%0A        for (int n = 11; n %3C 100; n++) %7B%0A            for (int d = n; d %3C 100; d++) %7B%0A                if (n %25 10 == 0 %7C%7C d %25 10 == 0 %7C%7C n == d) %7B%0A                    continue;%0A                %7D%0A                // create character array of the digits so they can be compared%0A                char%5B%5D nArray = Integer.toString(n).toCharArray();%0A                char%5B%5D dArray = Integer.toString(d).toCharArray();%0A                %0A                Check:%0A                // loop through digits and check for matches%0A                for (int i = 0; i %3C 2; i++) %7B%0A                    for (int j = 0; j %3C 2; j++) %7B%0A                        if (nArray%5Bi%5D == dArray%5Bj%5D) %7B%0A                            // cancel the matches and compare the fraction vale with the original value%0A                            int nRemaining = Character.getNumericValue(nArray%5B(i + 1) %25 2%5D);%0A                            int dRemaining = Character.getNumericValue(dArray%5B(j + 1) %25 2%5D);%0A                            if ((double)nRemaining / dRemaining == (double)n / d) %7B%0A                                nCombined *= n;%0A                                dCombined *= d;%0A                                break Check;%0A                            %7D%0A                        %7D%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A        %0A        // use the Sieve of Eratosthenes to find primes %0A        HashSet%3CInteger%3E sieve = new HashSet%3C%3E();%0A        ArrayList%3CInteger%3E primes = new ArrayList%3C%3E();%0A        for (int i = 2; i %3C= nCombined; i++) %7B%0A            if (!sieve.contains(i)) %7B%0A                primes.add(i);%0A                int j = 1;%0A                while (i * j %3C= nCombined) %7B%0A                    sieve.add(i * j);%0A                    j++;%0A                %7D%0A            %7D%0A        %7D%0A        %0A        // check for primes that reduce the fraction%0A        for (int i = 0; i %3C primes.size(); i++) %7B%0A            int tempPrime = primes.get(i);%0A            if (nCombined %25 tempPrime == 0 && dCombined %25 tempPrime == 0) %7B%0A                nCombined /= tempPrime;%0A                dCombined /= tempPrime;%0A                i--;%0A            %7D%0A        %7D%0A
         
@@ -2483,16 +2483,25 @@
 println(
+dCombined
 );%0A    %7D

Add solution to problem 33