PROBLEM LINK:Author: avi224 Editorialist: avi224 DIFFICULTY:CAKEWALK. PREREQUISITES:STL PROBLEM:Print the sum of all numbers in an array occurring exactly $K$ times. If there is no such number, print $1$. EXPLANATION:This can be implemented by using a map or unordered map in C++. Just take the sum of numbers whose frequency is $K$, considering each number only once.
This question is marked "community wiki".
asked 12 Apr '18, 23:34
