《剑指 Offer》专项突破版 - 面试题 32 和 33 : 详解与变位词相关的两道面试题(C++ 实现)
目录一、有效的变位词二、变位词组2.1-方法一2.2-方法二一、有效的变位词题目:给定两个字符串s和t,请判断它们是不是一组变位词。在一组变位词中,它们中的字符及每个字符出现的次数都相同,但字符的顺序不能相同。例如,"anagram"和"nagaram"就是一组变位词。分析:第3章已经讨论过与变位词相关的面试题。由于变位词与字符出现的次数相关,因此可以用一个哈希表来存储每个字符出现的次数。哈希表的