package ru.job4j.array;

import java.util.Arrays;
/**
 * Class ArrayDuplicate.
 *
 * @author Alexey Leishin (lepishin.ao@yandex.ru)
 * @version 1
 * @since 06.06.2017
 */
public class ArrayDuplicate {
	/**
	 * remove.
	 * @param array array.
	 * @return Arrays.
	 */
	public String[] remove(String[] array) {
		String[] words = new String[array.length];
		String addedWord = "";
		int count = 0;
		for (int i = 0; i < array.length; i++) {
			if (addedWord != array[i]) {
			words[count] = array[i];
			count++;
			addedWord = words[count - 1];
			}
		}
		return Arrays.copyOf(words, count);
	}
}
@@ -439,31 +439,65 @@
 %0A%09%09%09
-if (addedWord !
+for (int j = 0; j %3C= i; j++) %7B%0A%09%09%09%09if (array%5Bi%5D =
 = array%5B
 i%5D) 
@@ -496,14 +496,16 @@
 ray%5B
-i
+j
 %5D) %7B%0A
+%09%09
 %09%09%09w
@@ -509,21 +509,17 @@
 %09%09words%5B
-count
+i
 %5D = arra
@@ -524,27 +524,19 @@
 ray%5B
-i
+j
 %5D;%0A%09%09
-%09count++;%0A
 %09%09%09
+//
 adde
@@ -558,19 +558,33 @@
 ount
- - 1%5D;%0A%09%09%09%7D
+%5D;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09count++;
 %0A%09%09%7D

task 225_2