From 7659303fb09a7ed8bef5e086e5b7d56453c64885 Mon Sep 17 00:00:00 2001 From: Wong Ding Feng Date: Mon, 1 Jun 2026 17:23:01 +0800 Subject: [PATCH] docs: add populate-notes.mjs to leetcode/AGENTS.md --- .../dsa/arrays-hashing/0217-contains-duplicate.org | 6 ++++++ org/study_deck_02/roadmap.org | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/org/study_deck_02/dsa/arrays-hashing/0217-contains-duplicate.org b/org/study_deck_02/dsa/arrays-hashing/0217-contains-duplicate.org index 8d5701b..5957e9e 100644 --- a/org/study_deck_02/dsa/arrays-hashing/0217-contains-duplicate.org +++ b/org/study_deck_02/dsa/arrays-hashing/0217-contains-duplicate.org @@ -45,6 +45,12 @@ Write your approach here. #+begin_src python class Solution: def containsDuplicate(self, nums: List[int]) -> bool: + s = set() + for x in nums: + if x in s: + return True + s.add(x) + return False #+end_src ** TODO C++ diff --git a/org/study_deck_02/roadmap.org b/org/study_deck_02/roadmap.org index 016ed7f..b92eda1 100644 --- a/org/study_deck_02/roadmap.org +++ b/org/study_deck_02/roadmap.org @@ -21,8 +21,15 @@ Source: [[https://neetcode.io/roadmap][neetcode.io/roadmap]] Notes: [[file:dsa/arrays-hashing/0217-contains-duplicate.org]] ** TODO 0242. Valid Anagram :easy: :PROPERTIES: -:LEETCODE: [[https://leetcode.com/problems/valid-anagram/][Problem]] -:CPP: [[https://github.com/neetcode-gh/leetcode/blob/main/cpp/0242-valid-anagram.cpp][Solution]] +:LEETCODE: [[https://lclass Solution: + def containsDuplicate(self, nums: List[int]) -> bool: + s = set() + for x in nums: + if x in s: + return True + s.add(x) + return False +.com/neetcode-gh/leetcode/blob/main/cpp/0242-valid-anagram.cpp][Solution]] :PYTHON: [[https://github.com/neetcode-gh/leetcode/blob/main/python/0242-valid-anagram.py][Solution]] :VIDEO: [[https://youtube.com/watch?v=9UtInBqnCgA][Watch]] :END: