My LeetCode solutions and learning notes.
- Strategy: Two-pointer / Sliding Window.
- Logic: The window size represents the smallest answer found during the search.
- Note: Core logic is handwritten;
mainfunction and test cases were generated by AI (Gemini).
- Strategy: Hash Set / Set Difference.
-
Languages Implemented:
-
C++: Used
std::unordered_set(C++20contains). -
Python: Used set operators (
-). -
Go: Used
map[int]boolto simulate a set. -
Rust: Used
HashSetanddifference()method.
-
C++: Used
-
Key Concept: Leveraged each language's native set operations to achieve
$O(N + M)$ time complexity. -
Note:
mainfunctions for each language were generated by AI (Gemini).