Very good explanation. I was having a hard time understanding the prefix sum thing, thank you. I love that you use Excalidraw, it makes it very beautiful and readable. One note: mod still works fine for negative numbers. k mod p = k + n*p mod p, so adding or subtracting p is essentially the same as adding 0.
@Alpha-CodeАй бұрын
I think this is language dependent, could be wrong. Mod of negative numbers gives different results in different languages I think.
@zweitekonto9654Ай бұрын
Mod works fine. The language does not.
@arthurtancrediАй бұрын
Probably not works in Java then, I tested in Python and it works fine. But nice to know that I should be careful with that.