title: i have tried to do the problem on my own, but not getting any great results, also attaching my code with the problem
body: <p>In given integer array, if any integer is repeating then replace it with a number greater than that number which has not been inserted yet in the array.
  Eg. 1, 3, 4, 5, 3       Output: 1, 3, 4, 5, 6</p>
  
  <hr>
  
  <pre><code>class duplicates{
    public static void main(String[] args) {
      Scanner sc=new Scanner(System.in);
      System.out.println("input the size");
      int n = sc.nextInt();
      int arr[]=new int[n];
     System.out.println("enter the elements of an array");
      for (int i=0;i&lt;n;i++)
      {
         arr[i]=sc.nextInt();
      }
      Arrays.sort(arr);
  
      for(int i=0;i&lt;n;i++){
        for(int j=i+1;j&lt;n;j++){
          if(arr[i]==arr[j])
          {
            arr[j]=arr[n-1]+48;
            n--;
  
          }
        }
      }
     System.out.println("array is" + Arrays.toString(arr));
  
    }
  }
  </code></pre>