+38
−19
+48
−41
Loading
This time a brute-force solution. But at least it works correctly, and for such a small n as we have it should be fast enough. Also a suite of more compact test cases that cover more cases than the previous ones.