*Link to problem: https://codingcompetitions.withgoogle.com/codejam/round/000000000019fd27/0000000000209aa0 <https://codingcompetitions.withgoogle.com/codejam/round/000000000019fd27/0000000000209aa0>*
The "Analysis" section of Code Jam 2020 Qualification Round Problem 5, "Indicium" says: There are many creative ways to solve this test set. The Code Jam forum is > a good place to share and discuss different solutions! For example, we can > directly create Latin squares with the appropriate trace by modifying > structured Latin squares (for example, by modifying *circulant *Latin > squares). *I am very interested to know what alternative "creative" approaches people came up with to solve this problem.* One alternative solution that I am pretty sure should work is: Build a simple circulant Latin square. The trivial cases where K % N == 0, the solution is obvious. For the non-trivial cases, swap any two rows. This gives a matrix with a diagonal that has three unique symbols: A, B, and C where there are N - 2 instances of A, and one instance each of B and C. Then you can find the right values of A, B and C needed to achieve the right trace (as per the "Analysis" section) and simply swap symbols in the required way. As someone who is uncomfortable around graphs and graph-related algorithms, I am glad I thought of this solution. I am curious what other creative solutions people found. -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/google-code/f668e0d6-70a2-4af6-9e72-f8c7a75162e1%40googlegroups.com.