Answer:
2730
Step-by-step explanation:
the king has 15 flags, different colored, one of each color and he sends messages of three flags, in some specific order. For each message he can`t use two times the same flag because he leaves the three flags on the top of the castle wall (and he has only one of each color).
then we have a combination of 3 elements from a list of 15 elements, in wich the order of the elements matters and we can`t use one element more than one time
then there are
15x14x13 options
when the king chooses the first flag he has 15 options, then for the second flag there are only 14 flags left to choose, and then for the third flag he has to choose between the rest of 13 flags.
15x14x13=2730