Wait i forgot to change int to ll, I’m so sorry.
Shouldn’t he need to do modular division for the formula?
(I was looking at n*(n-1)/2 formula sorry)
For the division by
2, do you mean? No, I don’t think so -
ll tmp = (n*(n-1))/2;
handles the division appropriately, I think.
There should be editorials for hiring challenges also