Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions valid-anagram/jeongyunjae.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Solution:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정렬을 사용하기 때문에 시간 복잡도가 O(n) 풀이보다 떨어질 수 있습니다 Counter 활용해보는 것도 추천합니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다!

def isAnagram(self, s: str, t: str) -> bool:
sort_s = ''.join(sorted(s))
sort_t = ''.join(sorted(t))

return sort_s == sort_t