|
|
@@ -1,5 +1,6 @@
|
|
1
|
1
|
import java.util.List;
|
|
2
|
2
|
import java.util.Arrays;
|
|
|
3
|
+import java.util.*;
|
|
3
|
4
|
/**
|
|
4
|
5
|
* Created by leon on 1/29/18.
|
|
5
|
6
|
*/
|
|
|
@@ -90,7 +91,7 @@ public class StringArrayUtils {
|
|
90
|
91
|
|
|
91
|
92
|
}
|
|
92
|
93
|
return false;
|
|
93
|
|
-
|
|
|
94
|
+
|
|
94
|
95
|
// if (array.length%2 ==0){
|
|
95
|
96
|
// for (int i=0; i<array.length/2;i++){
|
|
96
|
97
|
// String temp = array[i];
|
|
|
@@ -116,16 +117,22 @@ public class StringArrayUtils {
|
|
116
|
117
|
* @return true if each letter in the alphabet has been used in the array
|
|
117
|
118
|
*/ // TODO
|
|
118
|
119
|
public static boolean isPangramic(String[] array) {
|
|
119
|
|
-
|
|
120
|
|
- return false;
|
|
|
120
|
+
|
|
|
121
|
+ String[] arr = {"The quick brown", "Fox jumps over", "The lazy dog"};
|
|
|
122
|
+ for (String element: arr){
|
|
|
123
|
+ if (!contains(arr,element)) // it is a boolean so just compare arr and element
|
|
|
124
|
+ return false;
|
|
|
125
|
+ }
|
|
|
126
|
+ return true;
|
|
121
|
127
|
}
|
|
122
|
|
-
|
|
123
|
|
- /**
|
|
124
|
|
- * @param array array of String objects
|
|
125
|
|
- * @param value value to check array for
|
|
126
|
|
- * @return number of occurrences the specified `value` has occurred
|
|
127
|
|
- */ // TODO
|
|
128
|
|
- public static int getNumberOfOccurrences(String[] array, String value) {
|
|
|
128
|
+
|
|
|
129
|
+
|
|
|
130
|
+ /**
|
|
|
131
|
+ * @param array array of String objects
|
|
|
132
|
+ * @param value value to check array for
|
|
|
133
|
+ * @return number of occurrences the specified `value` has occurred
|
|
|
134
|
+ */ // TODO
|
|
|
135
|
+ public static int getNumberOfOccurrences(String[] array, String value) {
|
|
129
|
136
|
return 0;
|
|
130
|
137
|
}
|
|
131
|
138
|
|