| 1 | class Solution { |
| 2 | public int minimumLength(String s) { |
| 3 | // N + 26 |
| 4 | int freq[] = new int[26]; |
| 5 | int n = s.length(); |
| 6 | for(int i=0;i<n;i++){ |
| 7 | freq[s.charAt(i) - 'a']++; |
| 8 | } |
| 9 | int count=0; |
| 10 | for(int i=0;i<26;i++){ |
| 11 | if(freq[i]>0){ |
| 12 | if(freq[i]%2==0){ |
| 13 | count+=2; |
| 14 | }else{ |
| 15 | count+=1; |
| 16 | } |
| 17 | } |
| 18 | } |
| 19 | return count; |
| 20 | } |
| 21 | } |
nothing calls this directly
no outgoing calls
no test coverage detected