We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Sherlock and Pairs
Sherlock and Pairs
Sort by
recency
|
134 Discussions
|
Please Login in order to post a comment
for those who are getting wrong answer for cpp code multiply 1ll when adding to ans variable long long ans = 0; for(auto v : mp){ ans += 1ll * v.second * (v.second-1); }
For solution in c++ or other languages where size of the integer matters, you have to change the template. You need
long long
to count and return in C++.1 line Python solution, 100%