Re: [LeetCode] 刷到面试 Grind169 C++

楼主: SuiseiLeda (星街雷达)   2023-03-15 17:00:45
242. Valid Anagram easy题
哈希表
第一次遇到这个
但还满好懂得
class Solution {
public:
bool isAnagram(string s, string t) {
int hash[26] = {0};
if(s.length()!=t.length()) return false;
for(int i=0;i<s.length();i++){
hash[s[i]-'a']++;
hash[t[i]-'a']

Links booklink

Contact Us: admin [ a t ] ucptt.com