Thursday, August 20, 2009

Practice Alien Number - Code Jam 2009

import java.util.*; import java.io.*; public class AlienNumber{ private static int digits = -1; private static int sourceIndex = -1; private static String targetNo = null; private static List sourcenos = new ArrayList(); private static List targetnos = new ArrayList(); private static boolean found = false; public static void main(String[] args)throws Exception{ BufferedReader br = new BufferedReader(new FileReader(args[0])); int noOfCases = Integer.parseInt(br.readLine().trim()); int i = 0; while(i < params =" br.readLine().split(" targetno =" params[0];" digits="="-1){" digits =" -1;" sourceindex =" sourcenos.size()-1;" sourcenos =" null;" digits="="-1){" digits =" -1;"> nos){ for(int j=0;j(); targetnos = new ArrayList(); found = false; System.gc(); } }