Mexi Liang 8 years ago
parent
commit
ad54bfe94e
1 changed files with 17 additions and 10 deletions
  1. 17
    10
      StringArrayUtils.java

+ 17
- 10
StringArrayUtils.java View File

1
 import java.util.List;
1
 import java.util.List;
2
 import java.util.Arrays;
2
 import java.util.Arrays;
3
+import java.util.*;
3
 /**
4
 /**
4
  * Created by leon on 1/29/18.
5
  * Created by leon on 1/29/18.
5
  */
6
  */
90
 
91
 
91
         }
92
         }
92
         return false;
93
         return false;
93
-        
94
+
94
         // if (array.length%2 ==0){
95
         // if (array.length%2 ==0){
95
         // for (int i=0; i<array.length/2;i++){
96
         // for (int i=0; i<array.length/2;i++){
96
         // String temp = array[i];
97
         // String temp = array[i];
116
      * @return true if each letter in the alphabet has been used in the array
117
      * @return true if each letter in the alphabet has been used in the array
117
      */ // TODO
118
      */ // TODO
118
     public static boolean isPangramic(String[] array) {
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
         return 0;
136
         return 0;
130
     }
137
     }
131
 
138