Hello, It seems that you are always trying to swap the first CS pair. This is not the optimal way to swap. Try the following case:
4 CSCS The optimal solution would be swapping the last two instructions: CSSC -> 4 damage. Your program would output 2 swaps that results in SCSC. See the analysis page for the maths behind it: https://codejam.withgoogle.com/2018/challenges/00000000000000cb/analysis/0000000000007966 -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/57bd1b93-81fd-414f-909f-8c768552bbc1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.