(String str)
| 8 | */ |
| 9 | class Solution { |
| 10 | public boolean isDuplicate(String str){ |
| 11 | int[] fre = new int[26]; |
| 12 | for(int i=0; i<str.length(); i++){ |
| 13 | int ind = str.charAt(i) - 'a'; |
| 14 | fre[ind]++; |
| 15 | if(fre[ind] > 1){ |
| 16 | return true; |
| 17 | } |
| 18 | } |
| 19 | return false; |
| 20 | } |
| 21 | public boolean buddyStrings(String A, String B) { |
| 22 | if(A.length() != B.length()){ |
| 23 | return false; |