Call a string of letters an almost palindrome if and the reverse of differ in exactly two places. Find the number of ways to order the letters in to get an almost palindrome.
Solution
Note that are used an odd number of times. Therefore, one must go in the middle spot and the other pair must match up. There are are ways to fill in the first six spots with the letters and a pair of different letters. The factor of 3 accounts for which letter goes in the middle.
Want a route through all this instead of an archive? The track
puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.