Skip to content

Commit 2bfcbac

Browse files
Time: 16 ms (53.61%), Space: 7.4 MB (59.42%) - LeetHub
1 parent d83f386 commit 2bfcbac

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎0242-valid-anagram/0242-valid-anagram.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
class Solution {
33
public:
44
bool isAnagram(string s, string t) {
5-
5+
if(s.length()!=t.length())
6+
return false;
67
sort(s.begin(), s.end());
78
sort(t.begin(), t.end());
89
if(s==t)

0 commit comments

Comments
 (0)