Project Euler – Problem 38

Problem 38: Given the following example:

192 x 1 = 192
192 x 2 = 384
192 x 3 = 576


By concatenating each product we get the 1 to 9 pandigital, 192384576. We will call 192384576 the concatenated product of 192 and (1,2,3)

What is the largest 1 to 9 pandigital 9-digit number that can be formed as the concatenated product of an integer with (1,2, … , n) where n > 1?

class runner
{
	public static void main (String[] args) throws java.lang.Exception
	{
		long time = System.currentTimeMillis();
 
		int limit = 1000000;		
		for(int n=1;n 0){
					int r = m%10;
					if(r == 0){
						break outerLoop;//Pandigital 1..9 doesn't contain 0.
					}
					else if(arr[r]){
						break outerLoop;
					}
					else arr[r] = true;
					m/=10;
				}
				result += o;
				i++;
			}
			
			if(result.length() != 9) continue;
			
			for(int j=1;j