Input A number then input number of line B.
Input B number.
check if number A compare B each line are duplicate at same position then B number at this line are Invalid
and check number of each B compare all line duplicate at same position are Invalid too.
Java 8
The number must not start with 0 and length must less than 20
Input A :1234
Input number of B line :4
The B number must not start with 0 and length must equal to A number
Input B line 1 :1234
Input B line 2 :3241
Input B line 3 :3547
Input B line 4 :5489
Result
Input A : 1234
Input B line 1 : 1234 = Invalid
Input B line 2 : 3241 = Invalid
Input B line 3 : 3547 = Invalid
Input B line 4 : 5489 = Valid
At project directory terminal run this for complie.
javac JavaTest.java
then run this for start.
java JavaTest