237.删除链表中的节点
题目链接
class Solution {
public:
void deleteNode(ListNode* node) {
*node = *(node -> next);
}
};
242.有效的字母异位词
题目链接
class Solution {
public:
bool isAnagram(string s, string t) {
ios::sync_with_stdio(0);
int *cnt = new int[26]{0};
if(s.size()!=t.size())return false;
for(auto i : s)cnt[i-'a']++;
for(auto i : t)if(--cnt[i-'a'] < 0)return false;
delete []cnt;
return true;
}
};