|
@@ -152,9 +152,19 @@ counter++;
|
152
|
152
|
* @return array of Strings with consecutive duplicates removes
|
153
|
153
|
*/ // TODO
|
154
|
154
|
public static String[] removeConsecutiveDuplicates(String[] array) {
|
|
155
|
+ String[] tempArr = new String[array.length];
|
|
156
|
+ int counter = 0;
|
|
157
|
+ for (int i=0; i<array.length-1; i++){
|
|
158
|
+ if (array[i].equals(array[i+1])){
|
|
159
|
+ continue;
|
|
160
|
+ } else {
|
|
161
|
+ tempArr[counter++]=array[i];
|
|
162
|
+ }
|
|
163
|
+ // int decrement = tempArr.indexOf(null);
|
|
164
|
+ }
|
155
|
165
|
|
156
|
|
-
|
157
|
|
-
|
|
166
|
+ System.out.print(tempArr);
|
|
167
|
+return array;
|
158
|
168
|
}
|
159
|
169
|
|
160
|
170
|
/**
|