瀏覽代碼

Got one problem

nmaidanos 8 年之前
父節點
當前提交
583eea1ed8
共有 1 個檔案被更改,包括 30 行新增1 行删除
  1. 30
    1
      StringArrayUtils.java

+ 30
- 1
StringArrayUtils.java 查看文件

1
  import java.util.*;
1
  import java.util.*;
2
+ import java.util.ArrayList;
2
 
3
 
3
 /**
4
 /**
4
  * Created by leon on 1/29/18.
5
  * Created by leon on 1/29/18.
66
      * @return true if the order of the array is the same backwards and forwards
67
      * @return true if the order of the array is the same backwards and forwards
67
      */ // TODO
68
      */ // TODO
68
     public static boolean isPalindromic(String[] array) {
69
     public static boolean isPalindromic(String[] array) {
69
-        return false;
70
+        boolean isPalindromic = true;
71
+        for(int i = 0; i < array.length/2 ; i++){
72
+            if(array[i] != array[( array.length - 1 ) - i]){
73
+                isPalindromic = false;
74
+                break;
75
+            };
76
+        }
77
+        return isPalindromic;
70
     }
78
     }
71
 
79
 
72
     /**
80
     /**
74
      * @return true if each letter in the alphabet has been used in the array
82
      * @return true if each letter in the alphabet has been used in the array
75
      */ // TODO
83
      */ // TODO
76
     public static boolean isPangramic(String[] array) {
84
     public static boolean isPangramic(String[] array) {
85
+        char[] alphabet = new char[26];
86
+       
87
+        for(String str: array){
88
+            char[] chars = str.toCharArray();
89
+            
90
+            
91
+        }
77
         return false;
92
         return false;
78
     }
93
     }
94
+    
95
+    private void isLetter(){
96
+        
97
+    }
98
+    
99
+    private void isInCharArray(char[] chars, char Char){
100
+    
101
+    }
102
+    
79
 
103
 
80
     /**
104
     /**
81
      * @param array array of String objects
105
      * @param array array of String objects
98
      * @return array with identical contents excluding values of `value`
122
      * @return array with identical contents excluding values of `value`
99
      */ // TODO
123
      */ // TODO
100
     public static String[] removeValue(String[] array, String valueToRemove) {
124
     public static String[] removeValue(String[] array, String valueToRemove) {
125
+        //ArrayList<String> strings = new ArrayList<String>(Arrays.asList(array));
126
+        
127
+        //for(int i = 0; i < string.size()
128
+        
129
+        
101
         return null;
130
         return null;
102
     }
131
     }
103
 
132