We gave the following string:

```
int [] array = {12, 23, -22, 0, 43, 545, -4, -55, 43, 12, 0, -999, -87}.

```

There must be two rows, one for storage and the other positive elements for the negative elements of string array, and extracting the necessary logic that will perform the appropriate elements and placing them in the appropriate thread.

In other words, in the line array that is given is to be obtained all the positive elements and be placed in a separate row. Also, all the elements to be obtained and the negative to be placed in a separate row.

You also need to determine the number of duplicates in the string array.

Of course, it is necessary functionality written to be applicable to any number of integers. But MY teacher said that my code doesn't have a target row and He gave me an example: Target strings are two additional rows you will place isolated positive and negative values. For example, if you have a string:

```
int arr = {1,2,3,4, -1, -2, -3, -4}

```

then the target ranges will be:

```
int pos = {1,2,3,4}
int hc = {-1, -2, -3, -4}

```

of course, this should make it programmable and not hard coded, as in this example. Now how can I improve my code?

```
public static void main(String[] args) {

    int array1[]= {12, 23, -22, 0, 43, 545, -4, -55, 43, 12, 0, -999, -87};

    System.out.println("Array 1 :");

    Arrays.sort(array1);

    for (int positive: array1) {

        if (positive >= -1)
            System.out.println("Positive numbers :" + positive+ "\t");
        }
        System.out.println();
        System.out.println("Array 2 :");

        for (int negative: array1) {
            if (negative >= -1) {

            }else{ System.out.println("Negative numbers :" +negative);
            }

        } 
        System.out.println();

        for (int i = 0; i < array1.length -1; i++) { 
             if (array1[i + 1 ] == array1[i]) {
                 System.out.println("Duplicate element found :" + array1[i]);
                 i = i + 1;

             }          

        }

    }           
}

```