|
@@ -184,15 +184,17 @@ return resultArr;
|
184
|
184
|
String tempString = "";
|
185
|
185
|
int counter = 0;
|
186
|
186
|
int decrement = 0;
|
187
|
|
- for (int i=0; i<array.length-1; i++){
|
188
|
|
- if (array[i].equals(array[i+1])){
|
189
|
|
- tempString = array[i] + array[i];
|
190
|
|
- continue;
|
191
|
|
- } else if (array[i].equals(array[i+1])){
|
|
187
|
+
|
|
188
|
+ for (int i=0; i<array.length-1; i++) {
|
|
189
|
+ tempString = array[i];
|
|
190
|
+ while (array[i].equals(array[i++])) {
|
|
191
|
+ tempString += array[i];
|
192
|
192
|
tempArr[counter++] = tempString;
|
193
|
|
- continue;
|
194
|
193
|
}
|
195
|
|
- else{
|
|
194
|
+ } else if (array[i].equals(array[i-1]))
|
|
195
|
+ { tempString = "";
|
|
196
|
+ continue;
|
|
197
|
+ } else {
|
196
|
198
|
tempArr[counter++]=array[i];
|
197
|
199
|
}
|
198
|
200
|
|