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:
+48
-3
@@ -1,18 +1,63 @@
|
||||
#+PROPERTY: STUDY_DECK_02
|
||||
* TODO 0003. Longest Substring Without Repeating Characters :medium:
|
||||
:PROPERTIES:
|
||||
:NEETCODE: [[file:../../roadmap.org::*0003. Longest Substring Without Repeating Characters][Roadmap]]
|
||||
:NEETCODE: [[file:../../roadmap.org::*0003. Longest Substring Without Repeating Characters][0003. Longest Substring Without Repeating Characters]]
|
||||
:END:
|
||||
|
||||
Given a string ~s~, find the length of the *longest* *substring* without duplicate characters.
|
||||
|
||||
*Example 1:*
|
||||
|
||||
|
||||
#+begin_src
|
||||
Input: s = "abcabcbb"
|
||||
Output: 3
|
||||
Explanation: The answer is "abc", with the length of 3. Note that "bca" and "cab" are also correct answers.
|
||||
#+end_src
|
||||
|
||||
|
||||
*Example 2:*
|
||||
|
||||
|
||||
#+begin_src
|
||||
Input: s = "bbbbb"
|
||||
Output: 1
|
||||
Explanation: The answer is "b", with the length of 1.
|
||||
#+end_src
|
||||
|
||||
|
||||
*Example 3:*
|
||||
|
||||
|
||||
#+begin_src
|
||||
Input: s = "pwwkew"
|
||||
Output: 3
|
||||
Explanation: The answer is "wke", with the length of 3.
|
||||
Notice that the answer must be a substring, "pwke" is a subsequence and not a substring.
|
||||
#+end_src
|
||||
|
||||
|
||||
*Constraints:*
|
||||
|
||||
- ~0 <= s.length <= 5 * 10^{4}~
|
||||
|
||||
- ~s~ consists of English letters, digits, symbols and spaces.
|
||||
|
||||
** TODO Approach
|
||||
Write your approach here.
|
||||
|
||||
** TODO Python
|
||||
#+begin_src python
|
||||
|
||||
class Solution:
|
||||
def lengthOfLongestSubstring(self, s: str) -> int:
|
||||
#+end_src
|
||||
|
||||
** TODO C++
|
||||
#+begin_src cpp
|
||||
|
||||
class Solution {
|
||||
public:
|
||||
int lengthOfLongestSubstring(string s) {
|
||||
|
||||
}
|
||||
};
|
||||
#+end_src
|
||||
|
||||
Reference in New Issue
Block a user