|
|
@@ -83,13 +83,25 @@ public class StringArrayUtils {
|
|
83
|
83
|
* @return true if each letter in the alphabet has been used in the array
|
|
84
|
84
|
*/ // TODO
|
|
85
|
85
|
public static boolean isPangramic(String[] array) {
|
|
86
|
|
-
|
|
|
86
|
+ boolean my = true;
|
|
87
|
87
|
for(char alphabet = 'a'; alphabet <= 'z'; alphabet++){
|
|
88
|
|
- if(alphabet >= 'a' && alphabet <= 'z'){
|
|
89
|
|
- return true;
|
|
|
88
|
+ boolean iKnow = false;
|
|
|
89
|
+
|
|
|
90
|
+ for(int i = 0; i < array.length; i++){
|
|
|
91
|
+ if(array[i].toLowerCase().contains(Character.toString(alphabet))){
|
|
|
92
|
+
|
|
|
93
|
+ iKnow = true;
|
|
|
94
|
+ break;
|
|
|
95
|
+
|
|
|
96
|
+ }
|
|
|
97
|
+
|
|
|
98
|
+ }
|
|
|
99
|
+ if(!iKnow){
|
|
|
100
|
+ my = false;
|
|
|
101
|
+ break;
|
|
90
|
102
|
}
|
|
91
|
103
|
}
|
|
92
|
|
- return false;
|
|
|
104
|
+ return my;
|
|
93
|
105
|
}
|
|
94
|
106
|
|
|
95
|
107
|
/**
|
|
|
@@ -113,15 +125,29 @@ public class StringArrayUtils {
|
|
113
|
125
|
* @return array with identical contents excluding values of `value`
|
|
114
|
126
|
*/ // TODO
|
|
115
|
127
|
public static String[] removeValue(String[] array, String valueToRemove) {
|
|
116
|
|
- return null;
|
|
|
128
|
+ int count = getNumberOfOccurrences(array,valueToRemove);
|
|
|
129
|
+ String[] cheese = new String[array.length - count];
|
|
|
130
|
+ int j = 0;
|
|
|
131
|
+ for(int i = 0; i < array.length; i++){
|
|
|
132
|
+ if(array[i] != valueToRemove){
|
|
|
133
|
+ cheese[j] = array[i];
|
|
|
134
|
+ j++;
|
|
|
135
|
+ }
|
|
|
136
|
+ }
|
|
|
137
|
+
|
|
|
138
|
+ return cheese;
|
|
117
|
139
|
}
|
|
118
|
140
|
|
|
119
|
|
- /**
|
|
|
141
|
+ /*
|
|
120
|
142
|
* @param array array of chars
|
|
121
|
143
|
* @return array of Strings with consecutive duplicates removes
|
|
122
|
144
|
*/ // TODO
|
|
123
|
145
|
public static String[] removeConsecutiveDuplicates(String[] array) {
|
|
|
146
|
+ String removeThese = new String();
|
|
|
147
|
+ int duplicate = getNumberOfOccurrences(array,removeThese);
|
|
|
148
|
+
|
|
124
|
149
|
return null;
|
|
|
150
|
+
|
|
125
|
151
|
}
|
|
126
|
152
|
|
|
127
|
153
|
/**
|