Mario Mariofil

Greenhorn
+ Follow
since Jul 07, 2016
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mario Mariofil

Jj Roberts wrote:Ah, I see. The problem is that you are only counting every time you find two of the same numbers, you are not counting how many there are of that number. Unfortunately I don't think the approach you are using at the moment will give you what you want. I suggest you start by counting how many there are of each number. Could you write some code to do that?



yes i can write that code. and that way it would solve this problem that I want to solve, after that i  can make condition. right ?
4 years ago

Jj Roberts wrote:You are trying to find the duplicate numbers in the array. 0, 4, and 12 are repeated in the array. You are getting output for the right numbers. What is missing? What do you want it to do?



Yes i was trying to find dupilcate in array, and after that i was think to print  number of duplicate element array. That numbers are duplicate and they are x times repeated.
In this example 0 ,4, 12 are 2 time repated. What i missed ?
Thank you
4 years ago

Jj Roberts wrote:Hello, welcome to Coderanch!

It seems some of your code is missing; the loops don't have closing brackets. What in particular can we help you with? Do you get errors when you try to compile your code?


i was put brackets here, i have in code brackets

int [] arr = { 4, 12,1,0,0,12,4};




outuput is :
4 is 1  repeated times.
12 is 1 repeated times.
 0 is 1 repeated times.

some of code mising, im trying to understand this, but i need help
4 years ago
Hello, i need helps. I learn arrays and i need the is to extract the duplicates from  arrays  and show how many times the duplicate number is repeated.

                 
I missed something and I need a little help.How to solve this problem, i need one more varibale to set ?
Thanks
       
4 years ago