The lists are
AM
MA
AY
YA
MY
YM
Are the six ways that these can be listed. There are 6 altogether.
If you know what the counting principle is you can do it this way.
The first letter is any choice 3
The second letter can be one of 2
The number of ways of doing this problem is 3*2 = 6
However the question does not make clear if duplicates are allowed. We are only told that the string consists of 2 letters. They could be the same. In that case you have three more answers.
AA
MM
YY
I think the answer is intended to be 6, but it could be 9.
Use 6.<<< Answer
But don't be surprised if 9 is correct.