Problem Statement  
An operation table tells you which value is produced when a particular operation is applied to two operands. For example, 0123 + 00000 0000 10123 or more succinctly 0123 20202 0202 30321 0321is a table for standard integer multiplication mod 4. In the table on the left, the first row and column refer to the operands. This information is implicit in the more succinct form. Looking at the table we can see that 2 is produced when the operation is applied to 2 and 3. More precisely, if the table above defines the operation @, then a@b is the value in row a column b of the table. Using a table you could describe any operation by putting the correct values in the table. In this problem you will be given two String[]s source and target which are tables describing two operations. The tables will be in the succinct form shown above, where the first row and column are assumed to correspond to 0, and so forth. For added convenience, all results will be single digits, the tables will always be square, and will never have more than 10 rows. In addition, you will be given a int[] mapping which will contain the same number of elements as source and target. mapping defines a function that maps the value i to mapping[i]. For example, if mapping = {2,2,1,3} then 0 and 1 map to 2, 2 maps to 1, and 3 maps to 3. A homomorphism, for the purposes of this problem, will be a mapping that preserves the following equality:
Your method will return a String[] containing all pairs (a,b) for which the above equality fails to hold true for the given mapping. The pair (a,b) should be denoted as (quotes for clarity) "(a,b)" where a,b have no extra leading zeros. Note that the String contains no spaces. The returned String[] should be sorted in ascending order by a value, with ties broken using ascending b values. There should be no repeats.  
Definition  
 
Constraints  
  source will contain between 2 and 10 elements inclusive  
  target will contain the same number of elements as source  
  mapping will contain the same number of elements as source  
  Each element of mapping must be between 0 and len1 inclusive, where len is the number of elements in source  
  Each element of source must contain exactly len characters, where len is the number of elements in source  
  Each element of target must contain exactly len characters, where len is the number of elements in source  
  Each character in source and target will be in the first len characters of (quotes for clarity) "0123456789", where len is the number of elements in source  
Examples  
0)  
 
1)  
 
2)  
 
3)  
 
4)  
