Files
cpp-flashcards/org/study_deck_02/dsa/arrays-hashing/0242-valid-anagram.org
T

47 lines
891 B
Org Mode
Raw Normal View History

#+PROPERTY: STUDY_DECK_02
* TODO 0242. Valid Anagram :easy:
:PROPERTIES:
:NEETCODE: [[file:../../roadmap.org::*0242. Valid Anagram][0242. Valid Anagram]]
:END:
Given two strings ~s~ and ~t~, return ~true~ if ~t~ is an anagram of ~s~, and ~false~ otherwise.
*Example 1:*
*Input:* s = "anagram", t = "nagaram"
*Output:* true
*Example 2:*
*Input:* s = "rat", t = "car"
*Output:* false
*Constraints:*
- ~1 <= s.length, t.length <= 5 * 10^{4}~
- ~s~ and ~t~ consist of lowercase English letters.
*Follow up:* What if the inputs contain Unicode characters? How would you adapt your solution to such a case?
** TODO Approach
Write your approach here.
** TODO Python
#+begin_src python
class Solution:
def isAnagram(self, s: str, t: str) -> bool:
#+end_src
** TODO C++
#+begin_src cpp
class Solution {
public:
bool isAnagram(string s, string t) {
}
};
#+end_src