Question:
https://codeforces.com/problemset/problem/459/B
My approach:
@dhruvilcodes there are 2 errors in your code
1, over flow in line no 17 use (long long) in front of count as its return type is int
2. write (n*(n+1))/2 carefully you are writing it as (n+1)*n/2 which is different if divides by 2 before multiplying n and n+1
this is the changed code
if you still have any issue feel free to ask and if clear mark it as resolved and rate my experience
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.