Respuesta :
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.
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.
Var arr = []
For (i = 0; i < 26; i++) {
For (j = 0; j < 26; j++) {
Console.log(arr.join([i][j]));
}
}
Along these lines but converting i and j to the ASCII letter based on number.. example 0=a 1=b 2=c...
For (i = 0; i < 26; i++) {
For (j = 0; j < 26; j++) {
Console.log(arr.join([i][j]));
}
}
Along these lines but converting i and j to the ASCII letter based on number.. example 0=a 1=b 2=c...