|
@@ -7,12 +7,12 @@ package rocks.zipcode.io.quiz3.arrays;
|
7
|
7
|
public class SquareArrayAnalyzer {
|
8
|
8
|
public static Boolean compare(Integer[] input, Integer[] squaredValues) {
|
9
|
9
|
|
10
|
|
- Integer[] squaredArray = new Integer[input.length];
|
|
10
|
+ Integer[] newArray = new Integer[input.length];
|
11
|
11
|
for (int i = 0; i < input.length; i++) {
|
12
|
|
- squaredArray[i] = input[i] * input[i];
|
|
12
|
+ newArray[i] = input[i] * input[i];
|
13
|
13
|
}
|
14
|
|
- for (int i = 0; i < squaredArray.length; i++) {
|
15
|
|
- if (squaredArray[i] == squaredValues[i]) {
|
|
14
|
+ for (int i = 0; i < newArray.length; i++) {
|
|
15
|
+ if (newArray[i] == squaredValues[i]) {
|
16
|
16
|
return true;
|
17
|
17
|
}
|
18
|
18
|
}
|