I have an array, and am looking for duplicates.
duplicates = false;
for(j = 0; j < zipcodeList.length; j++){
for(k = 0; k < zipcodeList.length; k++
Print all the duplicate elements. Output -1 when no repeating elements are found.
import java.util.*;
public class PrintDuplicate {
public static void main(String args[]){
HashMap h = new HashMap();
Scanner s=new Scanner(System.in);
int ii=s.nextInt();
int k=s.nextInt();
int[] arr=new int[k];
int[] arr1=new int[k];
int l=0;
for(int i=0; i0)
{
for(int i=0;i