A0132499W:Tennis Point Program

Although it looks compact, but you actually only listing down all the possible permutations and tackling it one by one. Try to combine some of the cases so the actual number of permutation can be reduced.