Had a strange hunch as I clicked submit that 39 might be based on substitution.
It is. [Row across, Column down]
1. Change X to O, O to triangle, triangle to X
2. Scroll each row to the right.
3. Scroll the first column down
[Where 'scroll' obviously wraps 3 back to 1]
If you spot, first column of first square is,
X
T
X
2nd column of 2nd square is
. O .
. X .
. O .
3rd of 3rd square is
. . T
. . O
. . T
You might have spotted 1.
This, by itself means it's either A or B because the 3rd row is
. . O
. . O
. . X
-------------
Next consider 3rd square down, the 2nd column is
. X .
. O .
. X .
It becomes
. . O
. . T
. . O
in the middle row
and thus for the answer square it's row 1
which we first substitute
T
X
T
and scroll down [step 3 above] to get :-
T
T
X
Which again gives us A or B.
Finally, a similar process for the remaining column should give you B for the final answer [which we know anyway] but :-
2nd square, first column [no need to bother looking at 3rd column first square]
X . .
O . .
T . .
becomes
. O .
. T .
. X .
for our answer square. Thus B is the answer.
E&OE, it's late, but I think it's right more or less.