feat: populate note files with problem descriptions and code stubs
Add populate-notes.mjs that fetches problem descriptions and Python/C++ code stubs from LeetCode's GraphQL API. Populated all 197 NeetCode 150 note files with: - Problem description (examples, constraints) - Python code stub (function signature) - C++ code stub (function signature + includes) API responses cached in leetcode/.cache/leetcode/ for instant re-runs.
This commit is contained in:
@@ -1,18 +1,46 @@
|
||||
#+PROPERTY: STUDY_DECK_02
|
||||
* TODO 0242. Valid Anagram :easy:
|
||||
:PROPERTIES:
|
||||
:NEETCODE: [[file:../../roadmap.org::*0242. Valid Anagram][Roadmap]]
|
||||
: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
|
||||
|
||||
Reference in New Issue
Block a user