Answer:
96
Explanation:
The 1st digit of the length 6 ternary string has no restriction. => 3 choices.
The 2nd digit of the length 6 ternary string cannot be the same digit as the 1st. => 2 choices.
This continues until the 6th digit.
Hence, we have 3 * 2⁵ = 96.