Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
// Java Coding Challenge - 09: Find out duplicate numbers using Array
//Title of this code //'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_45 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int[] numbers = {50, 55, 21, 55, 2, 12, 21, 21, 21, 21}; Arrays.sort(numbers); //2, 12, 21, 21, 21, 21, 21, 21, 50, 51 for (int i = 1; i < numbers.length; i++) { if (numbers[i] == numbers[i - 1]) { System.out.println("Duplicate: " + numbers[i]); } } } }
run
|
edit
|
history
|
help
0
Java Procedural Progamming
Problem_OnOff
JAVA # MEVSİMLER
codesingnal Code
calc exp nha
preincrement
Print out perfect numbers 0 – 10,000
jb14 isEven Links
get top k frequent elements ( Priority Queue implementation ) Language: Editor: Layout:
Fmt test