[LeetCode]Valid Anagram

public class Solution {
    public boolean isAnagram(String s, String t) {
        char[] first = s.toCharArray();
        Arrays.sort(first);
        char[] second = t.toCharArray();
        Arrays.sort(second);
        return new String(first).equals(new String(second));
    }
}

 

posted @ 2015-12-01 15:03  Weizheng_Love_Coding  阅读(115)  评论(0编辑  收藏  举报