Xcuello 5 anos atrás
pai
commit
6e8e39543f

+ 5
- 1
src/main/java/rocks/zipcode/quiz5/arrays/ArrayUtils.java Ver arquivo

@@ -25,9 +25,13 @@ public class ArrayUtils {
25 25
 
26 26
     public static String[] removeMiddleElement(String[] values) {
27 27
 
28
+        int x = (values.length - 1) / 2;
29
+        String[] copy = new String[x * 2];
28 30
 
29
-        return null;
31
+        System.arraycopy(values, 0, copy, 0, x);
32
+        System.arraycopy(values, values.length - x, copy, x, x);
30 33
 
34
+        return copy;
31 35
     }
32 36
 
33 37
     public static String getLastElement(String[] values) {

+ 1
- 1
src/main/java/rocks/zipcode/quiz5/fundamentals/StringUtils.java Ver arquivo

@@ -84,7 +84,7 @@ public class StringUtils {
84 84
             }
85 85
         }
86 86
 
87
-        return String.valueOf(chars);
87
+        return str;
88 88
     }
89 89
 
90 90
     public static String invertCasing(String str) {