Ask coding questions

← Back to all posts
List Element Duplication Help
Chill16 (1)

I am trying to write a program where I am given a random number between 1 and 365 and it will keep giving me numbers until I get three of the same numbers then I need to stop the program and print how many tries it took. I am struggling to try to find out how to keep track of all the duplicate numbers and how to stop the program.

Comments
hotnewtop
Coder100 (18208)

Use an arraylist. Loop through the array so you can get consecutive numbers.