https://leetcode.com/problems/valid-anagram/
class Solution {
function isAnagram($s, $t) {
$a_s = str_split($s);
$a_t = str_split($t);
sort($a_s);
sort($a_t);
return implode('', $a_s) === implode('', $a_t);
}
}
No comments:
Post a Comment