Back
Close

Matching letters

Statement

 Goal

Match all the numbers from the first list of letters to all of them in the second. If a character only is in the first list, output 'NONE' instead of where that numbers is on the second list. You can only match one character once. First output the index of where the first character of the first list is on the second list (index starts from 0). Next, do the same thing except by doing it with the second character. Then the third and all the others. The length of the lists are length

Example:
If length is 3 and the next inputs are:
A B C
B A C
Then output:
1
0
2
Input
Line 1: An integer length for the length of the list.
Line 2: length space separated strings part1 for the first list.
Line 3: length space separated strings part2 for the second list.
Output
The indexes of where the characters are on the first list in the second.
Constraints
1 ≤ length ≤ 10
part1 and part2 contain only uppercase letters.
Example
Input
3
A B C
B A C
Output
1
0
2

Game modes
Fastest, Shortest

Test cases
Example Test
Input
3 A B C B A C
Output
1 0 2

Validator 1 Validator
Input
3 A B C C B A
Output
2 1 0

Random characters Test
Input
3 H R O O H R
Output
1 2 0

Validator 2 Validator
Input
3 F I S F S I
Output
0 2 1

NONE Test
Input
3 G T D F S T
Output
NONE 2 NONE

Validator 3 Validator
Input
3 I O W D S F
Output
NONE NONE NONE

Repeat Test
Input
3 I O I I O O
Output
0 1 NONE

Validator 4 Validator
Input
3 G A G G O O
Output
0 NONE NONE

HUGE!!! Test
Input
5 D G S H X V D G S G
Output
1 2 3 NONE NONE

Validator 5 Validator
Input
5 A B D G A D S E J Q
Output
NONE NONE 0 NONE NONE

Solution language

Solution

Stub generator input