Add occurrences of thrice in java

In this challenge you need to check for thrice occurrences in array and sum it up.


Input Format - 
you will be taking a number as an input from STDIN which tells about the length of the array. On another line, array elements should be there with single space between them. 

Output Format - 
You need to print the sum of the numbers occurring Thrice. 

Sample Test Case: 
Sample Input:-12
9 8 7 7 8 6 5 4 7 8 1 2 

Sample Output - 
15

Explanation: 
elements 8 and 7 occurring Thrice and their sum is 15.

Comments

Popular posts from this blog

TRIGONOMETRY-(RATIOS,IDENTITIES AND HEIGHTS AND DISTANCES)

Reasoning-Number Series

Print Exact Slice Of String in Python