###### Easy-题目8：242. Valid Anagram

Given two strings s and t, write a function to determine if t is an anagram of s.
For example,
s = “anagram”, t = “nagaram”, return true.
s = “rat”, t = “car”, return false.
Note:
You may assume the string contains only lowercase alphabets.

(百度词典：anagram n. 由颠倒字母顺序而构成的字)

public class Solution {
public boolean isAnagram(String s, String t) {
if(s==null||t==null||s.length()!=t.length()){
return false;
}
char[] array1 = s.toCharArray();
char[] array2 = t.toCharArray();
Arrays.sort(array1);
Arrays.sort(array2);
return Arrays.equals(array1, array2);
}
}

6ms,beats 78.41%.众数：7ms 18.48%
Cmershen的碎碎念：

#### LeetCode（242）Valid Anagram

2015-11-17 13:33:46

#### LeetCode:242 Valid Anagram Java

2015-08-05 21:07:08

#### leetcode 242: Valid Anagram

2015-08-02 15:57:10

#### LeetCode 242. Valid Anagram 题解（C++）

2016-10-19 13:43:33

#### Leetcode：242. Valid Anagram（JAVA）

2016-03-01 11:55:19

#### 242. Valid Anagram [easy] (Python)

2016-05-14 15:07:05

#### leetcode 242. Valid Anagram | Map

2017-08-28 16:02:44

#### LeetCode 242. Valid Anagram (map使用)

2017-05-05 20:50:32

#### 242. Valid Anagram(Java)

2017-08-02 21:00:48

#### LeetCode242_Valid Anagram(判断两个字符串是不是由完全一样字符组成) Java题解

2015-08-20 14:33:59

## 不良信息举报

Easy-题目8：242. Valid Anagram