dak2 / algorithms

This repository stores my solutions to competition programming questions and implementations of algorithms.
0 stars 0 forks source link

242. Valid Anagram #3

Closed dak2 closed 7 months ago

dak2 commented 7 months ago

Link

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

Ans

Another Ans

https://leetcode.com/problems/valid-anagram/solutions/3687854/3-method-s-c-java-python-beginner-friendly

dak2 commented 7 months ago

https://github.com/dak2/LeetCode/pull/3/commits/5d11fe92a660c6fcc5b6f9f0fd5a86cecac00455 はsortして文字列を比較するがその分時間がかかるので、アルファベットのHash Tableを使って該当index要素にカウントして、次の文字で該当index要素を減算