(String[] args)
| 42 | } |
| 43 | |
| 44 | public static void main(String[] args) { |
| 45 | // TODO Auto-generated method stub |
| 46 | Scanner input = new Scanner(System.in); |
| 47 | int firstNumber, secondNumber; |
| 48 | String firstNumberStr, secondNumberStr; |
| 49 | String[] results; |
| 50 | String result; |
| 51 | |
| 52 | int T = input.nextInt(); |
| 53 | |
| 54 | while (T < 1) { |
| 55 | T = input.nextInt(); |
| 56 | } |
| 57 | results = new String[T]; |
| 58 | |
| 59 | for (int i = 0; i < T; i++) { |
| 60 | firstNumber = input.nextInt(); |
| 61 | |
| 62 | while (Integer.toString(firstNumber).length() != 2) { |
| 63 | firstNumber = input.nextInt(); |
| 64 | } |
| 65 | |
| 66 | secondNumber = input.nextInt(); |
| 67 | |
| 68 | while (Integer.toString(secondNumber).length() != 2) { |
| 69 | secondNumber = input.nextInt(); |
| 70 | } |
| 71 | |
| 72 | firstNumberStr = Integer.toString(firstNumber); |
| 73 | secondNumberStr = Integer.toString(secondNumber); |
| 74 | |
| 75 | result = ""; |
| 76 | |
| 77 | for (int j = 0; j < firstNumberStr.length(); j++) { |
| 78 | for (int j2 = 0; j2 < secondNumberStr.length(); j2++) { |
| 79 | if (firstNumberStr.charAt(j) == secondNumberStr.charAt(j2)) { |
| 80 | result = result + firstNumberStr.charAt(j); |
| 81 | break; |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | if (result == "") { |
| 86 | results[i] = "N"; |
| 87 | } else { |
| 88 | char[] a = result.toCharArray(); |
| 89 | Arrays.sort(a); |
| 90 | int[] aInteger = new int[a.length]; |
| 91 | |
| 92 | for (int j = 0; j < a.length; j++) { |
| 93 | aInteger[j] = Integer.parseInt(String.valueOf(a[j])); |
| 94 | } |
| 95 | |
| 96 | results[i] = removeDuplicateElements(aInteger); |
| 97 | } |
| 98 | |
| 99 | } |
| 100 | input.close(); |
| 101 |
nothing calls this directly
no test coverage detected