LeetCode solutions by tgic

Valid Anagram

https://leetcode.com/problems/valid-anagram

Last Update 2015-08-06 14:22:20 +0000 View on Github

Source code Read on Github

 1 public class Solution {
 2     public boolean isAnagram(String s, String t) {
 3         char[] S = s.toCharArray();
 4         char[] T = t.toCharArray();
 5 
 6         Arrays.sort(S);
 7         Arrays.sort(T);
 8 
 9         return Arrays.equals(S, T);
10     }
11 }
comments powered by Disqus

LeetCode solutions by tgic

  • LeetCode solutions by tgic
  • [email protected]
  • Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
  • tg123
  • tg123/leetcode

LeetCode java solutions by tgic