Getting run-time error in 1 testcase
same result even after using long long
hey @S19LPPP0159, size of freq array should never be n. if n=10, cum[2]=15, then freq[15] will be invalid location. You also need to take mod for negatives values too. I have made changes to your code. You can check them here https://ide.codingblocks.com/s/110411