package ru.job4j;

import java.util.Arrays;

/**.
*
* @author Anton Vasilyuk
* @version 1.0
* @since 0.1
*/

public class ArrayDublicate {
	/**.
	* method for delete dublicate
	* @param array array
	* @return result
	*/
	public String[] remove(String[] array) {
		int summdublicate = 0;
		for (int i = 0; i < array.length; i++) {
			String wordOne;
			wordOne = array[i];
			for (int y = 0; y < array.length; y++) {
				String wordTwo = array[y];
				if (wordOne == wordTwo & i != y) {
					array[i] = null;
					summdublicate++;
				}
			}
		}
		for (int z = 0; z < array.length; z++) {
			for (int a = array.length - 2; a >= 0; a--) {
				if (array[a] == null) {
					String b = array[a];
					array[a] = array[a + 1];
					array[a + 1] = b;
				}
			}
		}
		return Arrays.copyOf(array, array.length - summdublicate);
	}
}
@@ -488,181 +488,24 @@
 %09%09%09%09
-array%5Bi%5D = null;%0A%09%09%09%09%09summdublicate++;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09for (int z = 0; z %3C array.length; z++) %7B%0A%09%09%09for (int a = array.length - 2; a %3E= 0; a--) %7B%0A%09%09%09%09if (array%5Ba%5D == null) %7B
+summdublicate++;
 %0A%09%09%09
@@ -523,17 +523,17 @@
 = array%5B
-a
+y
 %5D;%0A%09%09%09%09%09
@@ -538,17 +538,17 @@
 %09%09array%5B
-a
+y
 %5D = arra
@@ -550,18 +550,29 @@
  array%5Ba
- +
+rray.length -
  1%5D;%0A%09%09%09
@@ -584,10 +584,21 @@
 ay%5Ba
- +
+rray.length -
  1%5D 
@@ -675,15 +675,19 @@
 ublicate
+ + 1
 );%0A%09%7D%0A%7D

add file for chapter_001_5.3