My solution seems to be the same solution as the authors but I am getting a WA.Both the solution and my codes seem to be similar Somebody please help me out in figuring the error in my submission
Here is a link to my submission: https://codeforces.net/contest/1401/submission/90597120
you are sorting the vector res after taking mod.
Thank you very much for the help. Got it now