|
@@ -4,7 +4,22 @@ package rocks.zipcode.io.quiz3.arrays;
|
4
|
4
|
* @author leon on 09/12/2018.
|
5
|
5
|
*/
|
6
|
6
|
public class SquareArrayAnalyzer {
|
7
|
|
- public static Boolean compare(Integer[] input, Integer[] squaredValues) {
|
8
|
|
- return null;
|
|
7
|
+ public static Boolean compare(Integer[] input, Integer[] squaredValues)
|
|
8
|
+ {
|
|
9
|
+ int count=0;
|
|
10
|
+
|
|
11
|
+ for (int i=0; i<input.length;i++){
|
|
12
|
+ for (int j=0;j<squaredValues.length;j++) {
|
|
13
|
+ if ((input[i] * input[i]) == squaredValues[j]) {
|
|
14
|
+ count++;
|
|
15
|
+ }
|
|
16
|
+ }
|
|
17
|
+ }
|
|
18
|
+ if(count==input.length)
|
|
19
|
+ {
|
|
20
|
+ return true;
|
|
21
|
+ }
|
|
22
|
+
|
|
23
|
+ return false;
|
9
|
24
|
}
|
10
|
25
|
}
|