From e10cc4257db1f2de160bcab7befecd93178cc0ec Mon Sep 17 00:00:00 2001 From: Wong Ding Feng Date: Mon, 8 Jun 2026 01:28:25 +0800 Subject: [PATCH] add flashcard generation tooling and binary search cards - gen-flashcards.py: auto-generate recognition cards from all problem files - toolkit/gen-problem-cards.org: 199 auto-generated problem cards - 5 binary search tool cards (std::binary_search, std::lower_bound, comparison, two-sum pattern, sorting gotcha) - two-sum.org: add binary search C++ attempt - lc-org.el: add doom emacs localleader keybinding support --- .../dsa/arrays-hashing/0001-two-sum.org | 21 +- .../lower-bound-vs-binary-search.org | 11 + .../sorting-destroys-indices.org | 10 + .../dsa/binary-search/std-binary-search.org | 14 + .../dsa/binary-search/std-lower-bound.org | 14 + .../dsa/binary-search/two-sum-lower-bound.org | 16 + org/study_deck_02/gen-flashcards.py | 158 ++ org/study_deck_02/lc-org.el | 24 +- .../toolkit/gen-problem-cards.org | 1793 +++++++++++++++++ 9 files changed, 2052 insertions(+), 9 deletions(-) create mode 100644 org/study_deck_02/dsa/binary-search/lower-bound-vs-binary-search.org create mode 100644 org/study_deck_02/dsa/binary-search/sorting-destroys-indices.org create mode 100644 org/study_deck_02/dsa/binary-search/std-binary-search.org create mode 100644 org/study_deck_02/dsa/binary-search/std-lower-bound.org create mode 100644 org/study_deck_02/dsa/binary-search/two-sum-lower-bound.org create mode 100644 org/study_deck_02/gen-flashcards.py create mode 100644 org/study_deck_02/toolkit/gen-problem-cards.org diff --git a/org/study_deck_02/dsa/arrays-hashing/0001-two-sum.org b/org/study_deck_02/dsa/arrays-hashing/0001-two-sum.org index 1ab48bd..cb5051c 100644 --- a/org/study_deck_02/dsa/arrays-hashing/0001-two-sum.org +++ b/org/study_deck_02/dsa/arrays-hashing/0001-two-sum.org @@ -67,10 +67,27 @@ class Solution: ** TODO C++ #+begin_src cpp :lc-problem 1 +#include class Solution { public: - vector twoSum(vector& nums, int target) { - + vector twoSum(vector& nums, int target) { + std::sort(nums.begin(), nums.end()); + for (int i=0; i< nums.size(); i++) { + int x = nums[i]; + if (x > target) { + return {}; + } + // TODO: c++ binary search, i forgot how to do this + int want = target - x + auto it = std::binary_learch(nums.begin() + i + 1, nums.end(), want); + if (it != nums.end() && *it == want) { + int wi = std::distance(nums.begin(), it) + return {i, wi} + } } + reuturn {}; + } }; #+end_src + +#+RESULTS: diff --git a/org/study_deck_02/dsa/binary-search/lower-bound-vs-binary-search.org b/org/study_deck_02/dsa/binary-search/lower-bound-vs-binary-search.org new file mode 100644 index 0000000..4349966 --- /dev/null +++ b/org/study_deck_02/dsa/binary-search/lower-bound-vs-binary-search.org @@ -0,0 +1,11 @@ +#+ANKI_DECK: study_deck_02 +* When to use lower_bound vs binary_search :cpp:binary-search:algorithm:retrieval::recognition: +:PROPERTIES: +:END: + +** Front +When should you use ~std::lower_bound~ instead of ~std::binary_search~? + +** Back +Use ~lower_bound~ when you need the *position/index* of the element. +Use ~binary_search~ when you only need to know *if it exists* (bool). diff --git a/org/study_deck_02/dsa/binary-search/sorting-destroys-indices.org b/org/study_deck_02/dsa/binary-search/sorting-destroys-indices.org new file mode 100644 index 0000000..89c75d1 --- /dev/null +++ b/org/study_deck_02/dsa/binary-search/sorting-destroys-indices.org @@ -0,0 +1,10 @@ +#+ANKI_DECK: study_deck_02 +* Two Sum gotcha: sorting destroys original indices :cpp:two-sum:binary-search:retrieval::recognition: +:PROPERTIES: +:END: + +** Front +If you sort ~nums~ in-place for Two Sum, what goes wrong? + +** Back +Sorting changes the indices. If the problem requires returning *original* indices, store ~{value, original_index}~ pairs before sorting. diff --git a/org/study_deck_02/dsa/binary-search/std-binary-search.org b/org/study_deck_02/dsa/binary-search/std-binary-search.org new file mode 100644 index 0000000..45c0db3 --- /dev/null +++ b/org/study_deck_02/dsa/binary-search/std-binary-search.org @@ -0,0 +1,14 @@ +#+ANKI_DECK: study_deck_02 +* std::binary_search: check element exists :cpp:binary-search:algorithm:retrieval::recognition: +:PROPERTIES: +:END: + +** Front +What does ~std::binary_search~ return, and what must the range be? + +** Back +Returns ~bool~ (true if element found). The range must be *sorted*. + +#+begin_src cpp +bool found = std::binary_search(vec.begin(), vec.end(), value); +#+end_src diff --git a/org/study_deck_02/dsa/binary-search/std-lower-bound.org b/org/study_deck_02/dsa/binary-search/std-lower-bound.org new file mode 100644 index 0000000..3337eb8 --- /dev/null +++ b/org/study_deck_02/dsa/binary-search/std-lower-bound.org @@ -0,0 +1,14 @@ +#+ANKI_DECK: study_deck_02 +* std::lower_bound: find position of element :cpp:binary-search:algorithm:retrieval::recognition: +:PROPERTIES: +:END: + +** Front +What does ~std::lower_bound~ return? + +** Back +An iterator to the first element *>=* the given value. Returns ~end()~ if no such element exists. + +#+begin_src cpp +auto it = std::lower_bound(vec.begin(), vec.end(), value); +#+end_src diff --git a/org/study_deck_02/dsa/binary-search/two-sum-lower-bound.org b/org/study_deck_02/dsa/binary-search/two-sum-lower-bound.org new file mode 100644 index 0000000..7e3e103 --- /dev/null +++ b/org/study_deck_02/dsa/binary-search/two-sum-lower-bound.org @@ -0,0 +1,16 @@ +#+ANKI_DECK: study_deck_02 +* Task: Two Sum complement lookup with lower_bound :cpp:binary-search:two-sum:retrieval::production: +:PROPERTIES: +:END: + +** Front +Given sorted ~nums~ and index ~i~, write C++ to check if ~target - nums[i]~ exists in the rest of the array using ~std::lower_bound~. + +** Back +#+begin_src cpp +int complement = target - nums[i]; +auto it = std::lower_bound(nums.begin() + i + 1, nums.end(), complement); +if (it != nums.end() && *it == complement) { + return {(int)i, (int)std::distance(nums.begin(), it)}; +} +#+end_src diff --git a/org/study_deck_02/gen-flashcards.py b/org/study_deck_02/gen-flashcards.py new file mode 100644 index 0000000..812f181 --- /dev/null +++ b/org/study_deck_02/gen-flashcards.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python3 +"""Auto-generate Anki flashcards from problem .org files. + +Generates one recognition card per problem: + Front: Problem number + name + Back: Problem statement (first paragraph) +""" + +import re +import sys +from pathlib import Path + +BASE = Path(__file__).parent +DSA = BASE / "dsa" +OUTPUT = BASE / "toolkit" / "gen-problem-cards.org" + +TOPIC_DISPLAY = { + "1-d-dynamic-programming": "1D DP", + "2-d-dynamic-programming": "2D DP", + "advanced-graphs": "Advanced Graphs", + "arrays-hashing": "Arrays & Hashing", + "backtracking": "Backtracking", + "binary-search": "Binary Search", + "bit-manipulation": "Bit Manipulation", + "graphs": "Graphs", + "greedy": "Greedy", + "heap-priority-queue": "Heap / Priority Queue", + "intervals": "Intervals", + "linked-list": "Linked List", + "math-geometry": "Math & Geometry", + "sliding-window": "Sliding Window", + "stack": "Stack", + "trees": "Trees", + "tries": "Tries", + "two-pointers": "Two Pointers", +} + + +def parse_file(path: Path) -> dict | None: + """Extract problem metadata and statement from an .org file.""" + text = path.read_text() + + # Match heading: * TODO 0217. Contains Duplicate :easy: + m = re.search( + r"^\* (?:TODO|DONE) (\d{4})\. (.+?) :(easy|medium|hard):", + text, + re.MULTILINE, + ) + if not m: + return None + + num = m.group(1) + name = m.group(2).strip() + difficulty = m.group(3) + + # Topic = parent directory name + topic_slug = path.parent.name + topic = TOPIC_DISPLAY.get(topic_slug, topic_slug.replace("-", " ").title()) + + # Problem statement: first non-empty, non-heading, non-property line after :END: + after_props = text[m.end():] + lines = after_props.split("\n") + statement_lines = [] + in_block = False + for line in lines: + stripped = line.strip() + if stripped == ":END:": + continue + if not stripped: + if statement_lines: + break + continue + if stripped.startswith("#+") or stripped.startswith("*") or stripped.startswith(":"): + if statement_lines: + break + continue + statement_lines.append(stripped) + + statement = " ".join(statement_lines).strip() + # Clean up org markup for plain text + statement = re.sub(r"[~=*/_]", "", statement) + + return { + "num": num, + "name": name, + "difficulty": difficulty, + "topic": topic, + "statement": statement, + "path": path, + } + + +def generate_cards(problems: list[dict]) -> str: + """Generate org-mode flashcard content.""" + parts = [] + parts.append("#+TITLE: Auto-Generated Problem Cards") + parts.append("#+ANKI_DECK: study_deck_02") + parts.append("") + + for p in sorted(problems, key=lambda x: int(x["num"])): + num = p["num"] + name = p["name"] + diff = p["difficulty"] + topic = p["topic"] + stmt = p["statement"] + + # Card: given problem name → what does it ask? + title = f"LC {num}. {name} — what does it ask?" + tags = f":leetcode:{diff}:{topic.replace(' ', '-').lower()}:retrieval::recognition:" + + parts.append(f"* {title} {tags}") + parts.append(":PROPERTIES:") + parts.append(":ANKI_NOTE_TYPE: Basic") + parts.append(":END:") + parts.append("** Front") + parts.append(f"What does LeetCode {num} *{name}* ask you to do?") + parts.append("** Back") + parts.append(stmt) + parts.append("") + + return "\n".join(parts) + + +def main(): + dry_run = "--dry-run" in sys.argv + + org_files = sorted(DSA.rglob("*.org")) + org_files = [f for f in org_files if f.name != "udfs.org"] + print(f"Found {len(org_files)} problem files") + + problems = [] + skipped = 0 + for f in org_files: + p = parse_file(f) + if p: + problems.append(p) + else: + skipped += 1 + print(f" skipped: {f.name}") + + print(f"Parsed: {len(problems)} problems, {skipped} skipped") + + content = generate_cards(problems) + + if dry_run: + print(f"\nWould write {len(problems)} cards to {OUTPUT}") + # Show first 3 cards as preview + preview = content.split("\n\n\n")[:3] + print("\n--- Preview ---") + print("\n\n".join(preview)) + else: + OUTPUT.parent.mkdir(parents=True, exist_ok=True) + OUTPUT.write_text(content) + print(f"\nWrote {len(problems)} cards to {OUTPUT}") + + +if __name__ == "__main__": + main() diff --git a/org/study_deck_02/lc-org.el b/org/study_deck_02/lc-org.el index fe94e55..6c8f995 100644 --- a/org/study_deck_02/lc-org.el +++ b/org/study_deck_02/lc-org.el @@ -71,22 +71,32 @@ Returns a plist (:problem :lang :input :code) or signals an error." (display-buffer (process-buffer proc))))) (display-buffer buf))) -(defvar lc-org-mode-map - (let ((map (make-sparse-keymap)) - (prefix (make-sparse-keymap))) +(defvar lc-org-mode-map (make-sparse-keymap) + "Keymap for `lc-org-mode'.") + +(when (and (boundp 'doom-version) (fboundp 'map!)) + (map! :map lc-org-mode-map + :localleader + :prefix "l" + "s" #'lc-org-submit + "r" #'lc-org-run + "t" #'lc-org-status + "p" #'lc-org-show-problem + "d" #'lc-org-daily)) + +(unless (and (boundp 'doom-version) (fboundp 'map!)) + (let ((prefix (make-sparse-keymap))) (define-key prefix (kbd "s") #'lc-org-submit) (define-key prefix (kbd "r") #'lc-org-run) (define-key prefix (kbd "t") #'lc-org-status) (define-key prefix (kbd "p") #'lc-org-show-problem) (define-key prefix (kbd "d") #'lc-org-daily) - (define-key map (kbd "C-c l") prefix) - map) - "Keymap for `lc-org-mode'.") + (define-key lc-org-mode-map (kbd "C-c l") prefix))) ;;;###autoload (define-minor-mode lc-org-mode "Minor mode for LeetCode CLI integration in org source blocks. -Keybindings under C-c l: +Keybindings under localleader l (SPC m l or , l): s submit — submit current block r run — run with test input t status — check submission status diff --git a/org/study_deck_02/toolkit/gen-problem-cards.org b/org/study_deck_02/toolkit/gen-problem-cards.org new file mode 100644 index 0000000..ff4a054 --- /dev/null +++ b/org/study_deck_02/toolkit/gen-problem-cards.org @@ -0,0 +1,1793 @@ +#+TITLE: Auto-Generated Problem Cards +#+ANKI_DECK: study_deck_02 + +* LC 0001. Two Sum — what does it ask? :leetcode:easy:arrays-&-hashing:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0001 *Two Sum* ask you to do? +** Back +Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. + +* LC 0002. Add Two Numbers — what does it ask? :leetcode:medium:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0002 *Add Two Numbers* ask you to do? +** Back +You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. + +* LC 0003. Longest Substring Without Repeating Characters — what does it ask? :leetcode:medium:sliding-window:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0003 *Longest Substring Without Repeating Characters* ask you to do? +** Back +Given a string s, find the length of the longest substring without duplicate characters. + +* LC 0004. Median of Two Sorted Arrays — what does it ask? :leetcode:hard:binary-search:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0004 *Median of Two Sorted Arrays* ask you to do? +** Back +Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. + +* LC 0005. Longest Palindromic Substring — what does it ask? :leetcode:medium:1d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0005 *Longest Palindromic Substring* ask you to do? +** Back +Given a string s, return the longest palindromic substring in s. + +* LC 0007. Reverse Integer — what does it ask? :leetcode:medium:bit-manipulation:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0007 *Reverse Integer* ask you to do? +** Back +Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-2^{31}, 2^{31} - 1], then return 0. + +* LC 0009. Palindrome Number — what does it ask? :leetcode:easy:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0009 *Palindrome Number* ask you to do? +** Back +Given an integer x, return true if x is a palindrome, and false otherwise. + +* LC 0010. Regular Expression Matching — what does it ask? :leetcode:hard:2d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0010 *Regular Expression Matching* ask you to do? +** Back +Given an input string s and a pattern p, implement regular expression matching with support for '.' and '' where: + +* LC 0011. Container With Most Water — what does it ask? :leetcode:medium:two-pointers:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0011 *Container With Most Water* ask you to do? +** Back +You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the i^{th} line are (i, 0) and (i, height[i]). + +* LC 0012. Integer to Roman — what does it ask? :leetcode:medium:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0012 *Integer to Roman* ask you to do? +** Back +Seven different symbols represent Roman numerals with the following values: + +* LC 0015. 3Sum — what does it ask? :leetcode:medium:two-pointers:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0015 *3Sum* ask you to do? +** Back +Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i ! j, i ! k, and j ! k, and nums[i] + nums[j] + nums[k] 0. + +* LC 0017. Letter Combinations of a Phone Number — what does it ask? :leetcode:medium:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0017 *Letter Combinations of a Phone Number* ask you to do? +** Back +Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. + +* LC 0019. Remove Nth Node From End of List — what does it ask? :leetcode:medium:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0019 *Remove Nth Node From End of List* ask you to do? +** Back +Given the head of a linked list, remove the n^{th} node from the end of the list and return its head. + +* LC 0020. Valid Parentheses — what does it ask? :leetcode:easy:stack:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0020 *Valid Parentheses* ask you to do? +** Back +Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. + +* LC 0021. Merge Two Sorted Lists — what does it ask? :leetcode:easy:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0021 *Merge Two Sorted Lists* ask you to do? +** Back +You are given the heads of two sorted linked lists list1 and list2. + +* LC 0022. Generate Parentheses — what does it ask? :leetcode:medium:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0022 *Generate Parentheses* ask you to do? +** Back +Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. + +* LC 0023. Merge K Sorted Lists — what does it ask? :leetcode:hard:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0023 *Merge K Sorted Lists* ask you to do? +** Back +You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. + +* LC 0025. Reverse Nodes In K Group — what does it ask? :leetcode:hard:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0025 *Reverse Nodes In K Group* ask you to do? +** Back +Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list. + +* LC 0033. Search In Rotated Sorted Array — what does it ask? :leetcode:medium:binary-search:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0033 *Search In Rotated Sorted Array* ask you to do? +** Back +There is an integer array nums sorted in ascending order (with distinct values). + +* LC 0036. Valid Sudoku — what does it ask? :leetcode:medium:arrays-&-hashing:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0036 *Valid Sudoku* ask you to do? +** Back +Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: + +* LC 0039. Combination Sum — what does it ask? :leetcode:medium:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0039 *Combination Sum* ask you to do? +** Back +Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order. + +* LC 0040. Combination Sum II — what does it ask? :leetcode:medium:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0040 *Combination Sum II* ask you to do? +** Back +Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target. + +* LC 0042. Trapping Rain Water — what does it ask? :leetcode:hard:two-pointers:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0042 *Trapping Rain Water* ask you to do? +** Back +Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. + +* LC 0043. Multiply Strings — what does it ask? :leetcode:medium:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0043 *Multiply Strings* ask you to do? +** Back +Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. + +* LC 0045. Jump Game II — what does it ask? :leetcode:medium:greedy:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0045 *Jump Game II* ask you to do? +** Back +You are given a 0-indexed array of integers nums of length n. You are initially positioned at index 0. + +* LC 0046. Permutations — what does it ask? :leetcode:medium:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0046 *Permutations* ask you to do? +** Back +Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. + +* LC 0048. Rotate Image — what does it ask? :leetcode:medium:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0048 *Rotate Image* ask you to do? +** Back +You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). + +* LC 0049. Group Anagrams — what does it ask? :leetcode:medium:arrays-&-hashing:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0049 *Group Anagrams* ask you to do? +** Back +Given an array of strings strs, group the anagrams together. You can return the answer in any order. + +* LC 0050. Pow(x, n) — what does it ask? :leetcode:medium:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0050 *Pow(x, n)* ask you to do? +** Back +Write your approach here. + +* LC 0051. N Queens — what does it ask? :leetcode:hard:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0051 *N Queens* ask you to do? +** Back +The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. + +* LC 0052. N Queens II — what does it ask? :leetcode:hard:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0052 *N Queens II* ask you to do? +** Back +The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. + +* LC 0053. Maximum Subarray — what does it ask? :leetcode:medium:greedy:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0053 *Maximum Subarray* ask you to do? +** Back +Given an integer array nums, find the subarray with the largest sum, and return its sum. + +* LC 0054. Spiral Matrix — what does it ask? :leetcode:medium:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0054 *Spiral Matrix* ask you to do? +** Back +Given an m x n matrix, return all elements of the matrix in spiral order. + +* LC 0055. Jump Game — what does it ask? :leetcode:medium:greedy:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0055 *Jump Game* ask you to do? +** Back +You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position. + +* LC 0056. Merge Intervals — what does it ask? :leetcode:medium:intervals:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0056 *Merge Intervals* ask you to do? +** Back +Given an array of intervals where intervals[i] [start{i}, end{i}], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. + +* LC 0057. Insert Interval — what does it ask? :leetcode:medium:intervals:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0057 *Insert Interval* ask you to do? +** Back +You are given an array of non-overlapping intervals intervals where intervals[i] [start{i}, end{i}] represent the start and the end of the i^{th} interval and intervals is sorted in ascending order by start{i}. You are also given an interval newInterval [start, end] that represents the start and end of another interval. + +* LC 0062. Unique Paths — what does it ask? :leetcode:medium:2d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0062 *Unique Paths* ask you to do? +** Back +There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m - 1][n - 1]). The robot can only move either down or right at any point in time. + +* LC 0066. Plus One — what does it ask? :leetcode:easy:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0066 *Plus One* ask you to do? +** Back +You are given a large integer represented as an integer array digits, where each digits[i] is the i^{th} digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0's. + +* LC 0070. Climbing Stairs — what does it ask? :leetcode:easy:1d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0070 *Climbing Stairs* ask you to do? +** Back +You are climbing a staircase. It takes n steps to reach the top. + +* LC 0072. Edit Distance — what does it ask? :leetcode:medium:2d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0072 *Edit Distance* ask you to do? +** Back +Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. + +* LC 0073. Set Matrix Zeroes — what does it ask? :leetcode:medium:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0073 *Set Matrix Zeroes* ask you to do? +** Back +Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's. + +* LC 0074. Search a 2D Matrix — what does it ask? :leetcode:medium:binary-search:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0074 *Search a 2D Matrix* ask you to do? +** Back +You are given an m x n integer matrix matrix with the following two properties: + +* LC 0076. Minimum Window Substring — what does it ask? :leetcode:hard:sliding-window:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0076 *Minimum Window Substring* ask you to do? +** Back +Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string "". + +* LC 0077. Combinations — what does it ask? :leetcode:medium:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0077 *Combinations* ask you to do? +** Back +Given two integers n and k, return all possible combinations of k numbers chosen from the range [1, n]. + +* LC 0078. Subsets — what does it ask? :leetcode:medium:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0078 *Subsets* ask you to do? +** Back +Given an integer array nums of unique elements, return all possible subsets (the power set). + +* LC 0079. Word Search — what does it ask? :leetcode:medium:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0079 *Word Search* ask you to do? +** Back +Given an m x n grid of characters board and a string word, return true if word exists in the grid. + +* LC 0084. Largest Rectangle In Histogram — what does it ask? :leetcode:hard:stack:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0084 *Largest Rectangle In Histogram* ask you to do? +** Back +Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram. + +* LC 0090. Subsets II — what does it ask? :leetcode:medium:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0090 *Subsets II* ask you to do? +** Back +Given an integer array nums that may contain duplicates, return all possible subsets (the power set). + +* LC 0091. Decode Ways — what does it ask? :leetcode:medium:1d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0091 *Decode Ways* ask you to do? +** Back +You have intercepted a secret message encoded as a string of numbers. The message is decoded via the following mapping: + +* LC 0097. Interleaving String — what does it ask? :leetcode:medium:2d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0097 *Interleaving String* ask you to do? +** Back +Given strings s1, s2, and s3, find whether s3 is formed by an interleaving of s1 and s2. + +* LC 0098. Validate Binary Search Tree — what does it ask? :leetcode:medium:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0098 *Validate Binary Search Tree* ask you to do? +** Back +Given the root of a binary tree, determine if it is a valid binary search tree (BST). + +* LC 0100. Same Tree — what does it ask? :leetcode:easy:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0100 *Same Tree* ask you to do? +** Back +Given the roots of two binary trees p and q, write a function to check if they are the same or not. + +* LC 0102. Binary Tree Level Order Traversal — what does it ask? :leetcode:medium:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0102 *Binary Tree Level Order Traversal* ask you to do? +** Back +Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). + +* LC 0104. Maximum Depth of Binary Tree — what does it ask? :leetcode:easy:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0104 *Maximum Depth of Binary Tree* ask you to do? +** Back +Given the root of a binary tree, return its maximum depth. + +* LC 0105. Construct Binary Tree From Preorder And Inorder Traversal — what does it ask? :leetcode:medium:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0105 *Construct Binary Tree From Preorder And Inorder Traversal* ask you to do? +** Back +Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree. + +* LC 0110. Balanced Binary Tree — what does it ask? :leetcode:easy:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0110 *Balanced Binary Tree* ask you to do? +** Back +Given a binary tree, determine if it is height-balanced. + +* LC 0115. Distinct Subsequences — what does it ask? :leetcode:hard:2d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0115 *Distinct Subsequences* ask you to do? +** Back +Given two strings s and t, return the number of distinct subsequences of s which equals t. + +* LC 0121. Best Time to Buy And Sell Stock — what does it ask? :leetcode:easy:sliding-window:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0121 *Best Time to Buy And Sell Stock* ask you to do? +** Back +You are given an array prices where prices[i] is the price of a given stock on the i^{th} day. + +* LC 0124. Binary Tree Maximum Path Sum — what does it ask? :leetcode:hard:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0124 *Binary Tree Maximum Path Sum* ask you to do? +** Back +A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. Note that the path does not need to pass through the root. + +* LC 0125. Valid Palindrome — what does it ask? :leetcode:easy:two-pointers:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0125 *Valid Palindrome* ask you to do? +** Back +A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers. + +* LC 0127. Word Ladder — what does it ask? :leetcode:hard:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0127 *Word Ladder* ask you to do? +** Back +A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s{1} -> s{2} -> ... -> s{k} such that: + +* LC 0128. Longest Consecutive Sequence — what does it ask? :leetcode:medium:arrays-&-hashing:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0128 *Longest Consecutive Sequence* ask you to do? +** Back +Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. + +* LC 0130. Surrounded Regions — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0130 *Surrounded Regions* ask you to do? +** Back +You are given an m x n matrix board containing letters 'X' and 'O', capture regions that are surrounded: + +* LC 0131. Palindrome Partitioning — what does it ask? :leetcode:medium:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0131 *Palindrome Partitioning* ask you to do? +** Back +Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. + +* LC 0133. Clone Graph — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0133 *Clone Graph* ask you to do? +** Back +Given a reference of a node in a connected undirected graph. + +* LC 0134. Gas Station — what does it ask? :leetcode:medium:greedy:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0134 *Gas Station* ask you to do? +** Back +There are n gas stations along a circular route, where the amount of gas at the i^{th} station is gas[i]. + +* LC 0136. Single Number — what does it ask? :leetcode:easy:bit-manipulation:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0136 *Single Number* ask you to do? +** Back +Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. + +* LC 0138. Copy List With Random Pointer — what does it ask? :leetcode:medium:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0138 *Copy List With Random Pointer* ask you to do? +** Back +A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null. + +* LC 0139. Word Break — what does it ask? :leetcode:medium:1d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0139 *Word Break* ask you to do? +** Back +Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words. + +* LC 0141. Linked List Cycle — what does it ask? :leetcode:easy:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0141 *Linked List Cycle* ask you to do? +** Back +Given head, the head of a linked list, determine if the linked list has a cycle in it. + +* LC 0143. Reorder List — what does it ask? :leetcode:medium:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0143 *Reorder List* ask you to do? +** Back +You are given the head of a singly linked-list. The list can be represented as: + +* LC 0146. LRU Cache — what does it ask? :leetcode:medium:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0146 *LRU Cache* ask you to do? +** Back +Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. + +* LC 0150. Evaluate Reverse Polish Notation — what does it ask? :leetcode:medium:stack:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0150 *Evaluate Reverse Polish Notation* ask you to do? +** Back +You are given an array of strings tokens that represents an arithmetic expression in a Reverse Polish Notation. + +* LC 0152. Maximum Product Subarray — what does it ask? :leetcode:medium:1d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0152 *Maximum Product Subarray* ask you to do? +** Back +Given an integer array nums, find a subarray that has the largest product, and return the product. + +* LC 0153. Find Minimum In Rotated Sorted Array — what does it ask? :leetcode:medium:binary-search:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0153 *Find Minimum In Rotated Sorted Array* ask you to do? +** Back +Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums [0,1,2,4,5,6,7] might become: + +* LC 0155. Min Stack — what does it ask? :leetcode:medium:stack:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0155 *Min Stack* ask you to do? +** Back +Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. + +* LC 0167. Two Sum II Input Array Is Sorted — what does it ask? :leetcode:medium:two-pointers:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0167 *Two Sum II Input Array Is Sorted* ask you to do? +** Back +Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index{1}] and numbers[index{2}] where 1 < index{1} < index{2} < numbers.length. + +* LC 0190. Reverse Bits — what does it ask? :leetcode:easy:bit-manipulation:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0190 *Reverse Bits* ask you to do? +** Back +Reverse bits of a given 32 bits signed integer. + +* LC 0191. Number of 1 Bits — what does it ask? :leetcode:easy:bit-manipulation:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0191 *Number of 1 Bits* ask you to do? +** Back +Given a positive integer n, write a function that returns the number of set bits in its binary representation (also known as the Hamming weight). + +* LC 0198. House Robber — what does it ask? :leetcode:medium:1d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0198 *House Robber* ask you to do? +** Back +You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and it will automatically contact the police if two adjacent houses were broken into on the same night. + +* LC 0199. Binary Tree Right Side View — what does it ask? :leetcode:medium:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0199 *Binary Tree Right Side View* ask you to do? +** Back +Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. + +* LC 0200. Number of Islands — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0200 *Number of Islands* ask you to do? +** Back +Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. + +* LC 0202. Happy Number — what does it ask? :leetcode:easy:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0202 *Happy Number* ask you to do? +** Back +Write an algorithm to determine if a number n is happy. + +* LC 0206. Reverse Linked List — what does it ask? :leetcode:easy:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0206 *Reverse Linked List* ask you to do? +** Back +Given the head of a singly linked list, reverse the list, and return the reversed list. + +* LC 0207. Course Schedule — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0207 *Course Schedule* ask you to do? +** Back +There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] [a{i}, b{i}] indicates that you must take course b{i} first if you want to take course a{i}. + +* LC 0208. Implement Trie Prefix Tree — what does it ask? :leetcode:medium:tries:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0208 *Implement Trie Prefix Tree* ask you to do? +** Back +A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker. + +* LC 0210. Course Schedule II — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0210 *Course Schedule II* ask you to do? +** Back +There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] [a{i}, b{i}] indicates that you must take course b{i} first if you want to take course a{i}. + +* LC 0211. Design Add And Search Words Data Structure — what does it ask? :leetcode:medium:tries:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0211 *Design Add And Search Words Data Structure* ask you to do? +** Back +Design a data structure that supports adding new words and finding if a string matches any previously added string. + +* LC 0212. Word Search II — what does it ask? :leetcode:hard:tries:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0212 *Word Search II* ask you to do? +** Back +Given an m x n board of characters and a list of strings words, return all words on the board. + +* LC 0213. House Robber II — what does it ask? :leetcode:medium:1d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0213 *House Robber II* ask you to do? +** Back +You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are arranged in a circle. That means the first house is the neighbor of the last one. Meanwhile, adjacent houses have a security system connected, and it will automatically contact the police if two adjacent houses were broken into on the same night. + +* LC 0215. Kth Largest Element In An Array — what does it ask? :leetcode:medium:heap-/-priority-queue:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0215 *Kth Largest Element In An Array* ask you to do? +** Back +Given an integer array nums and an integer k, return the k^{th} largest element in the array. + +* LC 0217. Contains Duplicate — what does it ask? :leetcode:easy:arrays-&-hashing:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0217 *Contains Duplicate* ask you to do? +** Back +Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. + +* LC 0226. Invert Binary Tree — what does it ask? :leetcode:easy:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0226 *Invert Binary Tree* ask you to do? +** Back +Given the root of a binary tree, invert the tree, and return its root. + +* LC 0230. Kth Smallest Element In a Bst — what does it ask? :leetcode:medium:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0230 *Kth Smallest Element In a Bst* ask you to do? +** Back +Given the root of a binary search tree, and an integer k, return the k^{th} smallest value (1-indexed) of all the values of the nodes in the tree. + +* LC 0231. Power of Two — what does it ask? :leetcode:easy:bit-manipulation:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0231 *Power of Two* ask you to do? +** Back +Given an integer n, return true if it is a power of two. Otherwise, return false. + +* LC 0235. Lowest Common Ancestor of a Binary Search Tree — what does it ask? :leetcode:medium:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0235 *Lowest Common Ancestor of a Binary Search Tree* ask you to do? +** Back +Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST. + +* LC 0238. Product of Array Except Self — what does it ask? :leetcode:medium:arrays-&-hashing:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0238 *Product of Array Except Self* ask you to do? +** Back +Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. + +* LC 0239. Sliding Window Maximum — what does it ask? :leetcode:hard:sliding-window:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0239 *Sliding Window Maximum* ask you to do? +** Back +You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. + +* LC 0242. Valid Anagram — what does it ask? :leetcode:easy:arrays-&-hashing:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0242 *Valid Anagram* ask you to do? +** Back +Given two strings s and t, return true if t is an anagram of s, and false otherwise. + +* LC 0252. Meeting Rooms — what does it ask? :leetcode:easy:intervals:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0252 *Meeting Rooms* ask you to do? +** Back +Write your approach here. + +* LC 0253. Meeting Rooms II — what does it ask? :leetcode:medium:intervals:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0253 *Meeting Rooms II* ask you to do? +** Back +Write your approach here. + +* LC 0259. 3Sum Smaller — what does it ask? :leetcode:medium:two-pointers:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0259 *3Sum Smaller* ask you to do? +** Back +Write your approach here. + +* LC 0260. Single Number III — what does it ask? :leetcode:medium:bit-manipulation:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0260 *Single Number III* ask you to do? +** Back +Given an integer array nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. You can return the answer in any order. + +* LC 0261. Graph Valid Tree — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0261 *Graph Valid Tree* ask you to do? +** Back +Write your approach here. + +* LC 0268. Missing Number — what does it ask? :leetcode:easy:bit-manipulation:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0268 *Missing Number* ask you to do? +** Back +Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. + +* LC 0269. Alien Dictionary — what does it ask? :leetcode:hard:advanced-graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0269 *Alien Dictionary* ask you to do? +** Back +Write your approach here. + +* LC 0271. Encode and Decode Strings — what does it ask? :leetcode:medium:arrays-&-hashing:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0271 *Encode and Decode Strings* ask you to do? +** Back +Write your approach here. + +* LC 0286. Walls And Gates — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0286 *Walls And Gates* ask you to do? +** Back +Write your approach here. + +* LC 0287. Find The Duplicate Number — what does it ask? :leetcode:medium:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0287 *Find The Duplicate Number* ask you to do? +** Back +Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. + +* LC 0295. Find Median From Data Stream — what does it ask? :leetcode:hard:heap-/-priority-queue:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0295 *Find Median From Data Stream* ask you to do? +** Back +The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value, and the median is the mean of the two middle values. + +* LC 0296. Best Meeting Point — what does it ask? :leetcode:hard:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0296 *Best Meeting Point* ask you to do? +** Back +Write your approach here. + +* LC 0297. Serialize And Deserialize Binary Tree — what does it ask? :leetcode:hard:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0297 *Serialize And Deserialize Binary Tree* ask you to do? +** Back +Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment. + +* LC 0300. Longest Increasing Subsequence — what does it ask? :leetcode:medium:1d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0300 *Longest Increasing Subsequence* ask you to do? +** Back +Given an integer array nums, return the length of the longest strictly increasing subsequence. + +* LC 0309. Best Time to Buy And Sell Stock With Cooldown — what does it ask? :leetcode:medium:2d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0309 *Best Time to Buy And Sell Stock With Cooldown* ask you to do? +** Back +You are given an array prices where prices[i] is the price of a given stock on the i^{th} day. + +* LC 0312. Burst Balloons — what does it ask? :leetcode:hard:2d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0312 *Burst Balloons* ask you to do? +** Back +You are given n balloons, indexed from 0 to n - 1. Each balloon is painted with a number on it represented by an array nums. You are asked to burst all the balloons. + +* LC 0322. Coin Change — what does it ask? :leetcode:medium:1d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0322 *Coin Change* ask you to do? +** Back +You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. + +* LC 0323. Number of Connected Components In An Undirected Graph — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0323 *Number of Connected Components In An Undirected Graph* ask you to do? +** Back +Write your approach here. + +* LC 0329. Longest Increasing Path In a Matrix — what does it ask? :leetcode:hard:2d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0329 *Longest Increasing Path In a Matrix* ask you to do? +** Back +Given an m x n integers matrix, return the length of the longest increasing path in matrix. + +* LC 0332. Reconstruct Itinerary — what does it ask? :leetcode:hard:advanced-graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0332 *Reconstruct Itinerary* ask you to do? +** Back +You are given a list of airline tickets where tickets[i] [from{i}, to{i}] represent the departure and the arrival airports of one flight. Reconstruct the itinerary in order and return it. + +* LC 0338. Counting Bits — what does it ask? :leetcode:easy:bit-manipulation:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0338 *Counting Bits* ask you to do? +** Back +Given an integer n, return an array ans of length n + 1 such that for each i (0 < i < n), ans[i] is the number of 1's in the binary representation of i. + +* LC 0344. Reverse String — what does it ask? :leetcode:easy:two-pointers:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0344 *Reverse String* ask you to do? +** Back +Write a function that reverses a string. The input string is given as an array of characters s. + +* LC 0347. Top K Frequent Elements — what does it ask? :leetcode:medium:arrays-&-hashing:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0347 *Top K Frequent Elements* ask you to do? +** Back +Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order. + +* LC 0351. Android Unlock Patterns — what does it ask? :leetcode:medium:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0351 *Android Unlock Patterns* ask you to do? +** Back +Write your approach here. + +* LC 0355. Design Twitter — what does it ask? :leetcode:medium:heap-/-priority-queue:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0355 *Design Twitter* ask you to do? +** Back +Design a simplified version of Twitter where users can post tweets, followunfollow another user, and is able to see the 10 most recent tweets in the user's news feed. + +* LC 0371. Sum of Two Integers — what does it ask? :leetcode:medium:bit-manipulation:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0371 *Sum of Two Integers* ask you to do? +** Back +Given two integers a and b, return the sum of the two integers without using the operators + and -. + +* LC 0416. Partition Equal Subset Sum — what does it ask? :leetcode:medium:1d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0416 *Partition Equal Subset Sum* ask you to do? +** Back +Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or false otherwise. + +* LC 0417. Pacific Atlantic Water Flow — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0417 *Pacific Atlantic Water Flow* ask you to do? +** Back +There is an m x n rectangular island that borders both the Pacific Ocean and Atlantic Ocean. The Pacific Ocean touches the island's left and top edges, and the Atlantic Ocean touches the island's right and bottom edges. + +* LC 0424. Longest Repeating Character Replacement — what does it ask? :leetcode:medium:sliding-window:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0424 *Longest Repeating Character Replacement* ask you to do? +** Back +You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can perform this operation at most k times. + +* LC 0435. Non Overlapping Intervals — what does it ask? :leetcode:medium:intervals:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0435 *Non Overlapping Intervals* ask you to do? +** Back +Given an array of intervals intervals where intervals[i] [start{i}, end{i}], return the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping. + +* LC 0494. Target Sum — what does it ask? :leetcode:medium:2d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0494 *Target Sum* ask you to do? +** Back +You are given an integer array nums and an integer target. + +* LC 0518. Coin Change II — what does it ask? :leetcode:medium:2d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0518 *Coin Change II* ask you to do? +** Back +You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. + +* LC 0543. Diameter of Binary Tree — what does it ask? :leetcode:easy:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0543 *Diameter of Binary Tree* ask you to do? +** Back +Given the root of a binary tree, return the length of the diameter of the tree. + +* LC 0567. Permutation In String — what does it ask? :leetcode:medium:sliding-window:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0567 *Permutation In String* ask you to do? +** Back +Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise. + +* LC 0572. Subtree of Another Tree — what does it ask? :leetcode:easy:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0572 *Subtree of Another Tree* ask you to do? +** Back +Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false otherwise. + +* LC 0590. N-ary Tree Postorder Traversal — what does it ask? :leetcode:easy:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0590 *N-ary Tree Postorder Traversal* ask you to do? +** Back +Given the root of an n-ary tree, return the postorder traversal of its nodes' values. + +* LC 0621. Task Scheduler — what does it ask? :leetcode:medium:heap-/-priority-queue:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0621 *Task Scheduler* ask you to do? +** Back +You are given an array of CPU tasks, each labeled with a letter from A to Z, and a number n. Each CPU interval can be idle or allow the completion of one task. Tasks can be completed in any order, but there's a constraint: there has to be a gap of at least n intervals between two tasks with the same label. + +* LC 0647. Palindromic Substrings — what does it ask? :leetcode:medium:1d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0647 *Palindromic Substrings* ask you to do? +** Back +Given a string s, return the number of palindromic substrings in it. + +* LC 0656. Coin Path — what does it ask? :leetcode:hard:1d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0656 *Coin Path* ask you to do? +** Back +Write your approach here. + +* LC 0678. Valid Parenthesis String — what does it ask? :leetcode:medium:greedy:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0678 *Valid Parenthesis String* ask you to do? +** Back +Given a string s containing only three types of characters: '(', ')' and '', return true if s is valid. + +* LC 0682. Baseball Game — what does it ask? :leetcode:easy:stack:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0682 *Baseball Game* ask you to do? +** Back +You are keeping the scores for a baseball game with strange rules. At the beginning of the game, you start with an empty record. + +* LC 0684. Redundant Connection — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0684 *Redundant Connection* ask you to do? +** Back +In this problem, a tree is an undirected graph that is connected and has no cycles. + +* LC 0695. Max Area of Island — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0695 *Max Area of Island* ask you to do? +** Back +You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water. + +* LC 0703. Kth Largest Element In a Stream — what does it ask? :leetcode:easy:heap-/-priority-queue:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0703 *Kth Largest Element In a Stream* ask you to do? +** Back +You are part of a university admissions office and need to keep track of the kth highest test score from applicants in real-time. This helps to determine cut-off marks for interviews and admissions dynamically as new applicants submit their scores. + +* LC 0704. Binary Search — what does it ask? :leetcode:easy:binary-search:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0704 *Binary Search* ask you to do? +** Back +Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1. + +* LC 0719. Find K-th Smallest Pair Distance — what does it ask? :leetcode:hard:binary-search:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0719 *Find K-th Smallest Pair Distance* ask you to do? +** Back +The distance of a pair of integers a and b is defined as the absolute difference between a and b. + +* LC 0725. Split Linked List in Parts — what does it ask? :leetcode:medium:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0725 *Split Linked List in Parts* ask you to do? +** Back +Given the head of a singly linked list and an integer k, split the linked list into k consecutive linked list parts. + +* LC 0726. Number of Atoms — what does it ask? :leetcode:hard:stack:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0726 *Number of Atoms* ask you to do? +** Back +Given a string formula representing a chemical formula, return the count of each atom. + +* LC 0739. Daily Temperatures — what does it ask? :leetcode:medium:stack:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0739 *Daily Temperatures* ask you to do? +** Back +Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the i^{th} day to get a warmer temperature. If there is no future day for which this is possible, keep answer[i] 0 instead. + +* LC 0743. Network Delay Time — what does it ask? :leetcode:medium:advanced-graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0743 *Network Delay Time* ask you to do? +** Back +You are given a network of n nodes, labeled from 1 to n. You are also given times, a list of travel times as directed edges times[i] (u{i}, v{i}, w{i}), where u{i} is the source node, v{i} is the target node, and w{i} is the time it takes for a signal to travel from source to target. + +* LC 0746. Min Cost Climbing Stairs — what does it ask? :leetcode:easy:1d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0746 *Min Cost Climbing Stairs* ask you to do? +** Back +You are given an integer array cost where cost[i] is the cost of i^{th} step on a staircase. Once you pay the cost, you can either climb one or two steps. + +* LC 0763. Partition Labels — what does it ask? :leetcode:medium:greedy:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0763 *Partition Labels* ask you to do? +** Back +You are given a string s. We want to partition the string into as many parts as possible so that each letter appears in at most one part. For example, the string "ababcc" can be partitioned into ["abab", "cc"], but partitions such as ["aba", "bcc"] or ["ab", "ab", "cc"] are invalid. + +* LC 0778. Swim In Rising Water — what does it ask? :leetcode:hard:advanced-graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0778 *Swim In Rising Water* ask you to do? +** Back +You are given an n x n integer matrix grid where each value grid[i][j] represents the elevation at that point (i, j). + +* LC 0787. Cheapest Flights Within K Stops — what does it ask? :leetcode:medium:advanced-graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0787 *Cheapest Flights Within K Stops* ask you to do? +** Back +There are n cities connected by some number of flights. You are given an array flights where flights[i] [from{i}, to{i}, price{i}] indicates that there is a flight from city from{i} to city to{i} with cost price{i}. + +* LC 0802. Find Eventual Safe States — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0802 *Find Eventual Safe States* ask you to do? +** Back +There is a directed graph of n nodes with each node labeled from 0 to n - 1. The graph is represented by a 0-indexed 2D integer array graph where graph[i] is an integer array of nodes adjacent to node i, meaning there is an edge from node i to each node in graph[i]. + +* LC 0840. Magic Squares In Grid — what does it ask? :leetcode:medium:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0840 *Magic Squares In Grid* ask you to do? +** Back +A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum. + +* LC 0846. Hand of Straights — what does it ask? :leetcode:medium:greedy:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0846 *Hand of Straights* ask you to do? +** Back +Alice has some number of cards and she wants to rearrange the cards into groups so that each group is of size groupSize, and consists of groupSize consecutive cards. + +* LC 0853. Car Fleet — what does it ask? :leetcode:medium:stack:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0853 *Car Fleet* ask you to do? +** Back +There are n cars at given miles away from the starting mile 0, traveling to reach the mile target. + +* LC 0875. Koko Eating Bananas — what does it ask? :leetcode:medium:binary-search:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0875 *Koko Eating Bananas* ask you to do? +** Back +Koko loves to eat bananas. There are n piles of bananas, the i^{th} pile has piles[i] bananas. The guards have gone and will come back in h hours. + +* LC 0901. Online Stock Span — what does it ask? :leetcode:medium:stack:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0901 *Online Stock Span* ask you to do? +** Back +Design an algorithm that collects daily price quotes for some stock and returns the span of that stock's price for the current day. + +* LC 0945. Minimum Increment to Make Array Unique — what does it ask? :leetcode:medium:greedy:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0945 *Minimum Increment to Make Array Unique* ask you to do? +** Back +You are given an integer array nums. In one move, you can pick an index i where 0 < i < nums.length and increment nums[i] by 1. + +* LC 0973. K Closest Points to Origin — what does it ask? :leetcode:medium:heap-/-priority-queue:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0973 *K Closest Points to Origin* ask you to do? +** Back +Given an array of points where points[i] [x{i}, y{i}] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0). + +* LC 0978. Longest Turbulent Subarray — what does it ask? :leetcode:medium:greedy:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0978 *Longest Turbulent Subarray* ask you to do? +** Back +Given an integer array arr, return the length of a maximum size turbulent subarray of arr. + +* LC 0981. Time Based Key Value Store — what does it ask? :leetcode:medium:binary-search:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0981 *Time Based Key Value Store* ask you to do? +** Back +Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain timestamp. + +* LC 0986. Interval List Intersections — what does it ask? :leetcode:medium:intervals:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0986 *Interval List Intersections* ask you to do? +** Back +You are given two lists of closed intervals, firstList and secondList, where firstList[i] [start{i}, end{i}] and secondList[j] [start{j}, end{j}]. Each list of intervals is pairwise disjoint and in sorted order. + +* LC 0994. Rotting Oranges — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 0994 *Rotting Oranges* ask you to do? +** Back +You are given an m x n grid where each cell can have one of three values: + +* LC 1028. Recover a Tree From Preorder Traversal — what does it ask? :leetcode:hard:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1028 *Recover a Tree From Preorder Traversal* ask you to do? +** Back +We run a preorder depth-first search (DFS) on the root of a binary tree. + +* LC 1046. Last Stone Weight — what does it ask? :leetcode:easy:heap-/-priority-queue:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1046 *Last Stone Weight* ask you to do? +** Back +You are given an array of integers stones where stones[i] is the weight of the i^{th} stone. + +* LC 1079. Letter Tile Possibilities — what does it ask? :leetcode:medium:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1079 *Letter Tile Possibilities* ask you to do? +** Back +You have n tiles, where each tile has one letter tiles[i] printed on it. + +* LC 1143. Longest Common Subsequence — what does it ask? :leetcode:medium:2d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1143 *Longest Common Subsequence* ask you to do? +** Back +Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0. + +* LC 1166. Design File System — what does it ask? :leetcode:medium:tries:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1166 *Design File System* ask you to do? +** Back +Write your approach here. + +* LC 1220. Count Vowels Permutation — what does it ask? :leetcode:hard:2d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1220 *Count Vowels Permutation* ask you to do? +** Back +Given an integer n, your task is to count how many strings of length n can be formed under the following rules: + +* LC 1376. Time Needed to Inform All Employees — what does it ask? :leetcode:medium:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1376 *Time Needed to Inform All Employees* ask you to do? +** Back +A company has n employees with a unique ID for each employee from 0 to n - 1. The head of the company is the one with headID. + +* LC 1408. String Matching in an Array — what does it ask? :leetcode:easy:arrays-&-hashing:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1408 *String Matching in an Array* ask you to do? +** Back +Given an array of string words, return all strings in words that are a substring of another word. You can return the answer in any order. + +* LC 1448. Count Good Nodes In Binary Tree — what does it ask? :leetcode:medium:trees:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1448 *Count Good Nodes In Binary Tree* ask you to do? +** Back +Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X. + +* LC 1472. Design Browser History — what does it ask? :leetcode:medium:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1472 *Design Browser History* ask you to do? +** Back +You have a browser of one tab where you start on the homepage and you can visit another url, get back in the history number of steps or move forward in the history number of steps. + +* LC 1544. Make The String Great — what does it ask? :leetcode:easy:stack:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1544 *Make The String Great* ask you to do? +** Back +Given a string s of lower and upper case English letters. + +* LC 1584. Min Cost to Connect All Points — what does it ask? :leetcode:medium:advanced-graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1584 *Min Cost to Connect All Points* ask you to do? +** Back +You are given an array points representing integer coordinates of some points on a 2D-plane, where points[i] [x{i}, y{i}]. + +* LC 1721. Swapping Nodes in a Linked List — what does it ask? :leetcode:medium:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1721 *Swapping Nodes in a Linked List* ask you to do? +** Back +You are given the head of a linked list, and an integer k. + +* LC 1769. Minimum Number of Operations to Move All Balls to Each Box — what does it ask? :leetcode:medium:arrays-&-hashing:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1769 *Minimum Number of Operations to Move All Balls to Each Box* ask you to do? +** Back +You have n boxes. You are given a binary string boxes of length n, where boxes[i] is '0' if the i^{th} box is empty, and '1' if it contains one ball. + +* LC 1780. Check if Number is a Sum of Powers of Three — what does it ask? :leetcode:medium:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1780 *Check if Number is a Sum of Powers of Three* ask you to do? +** Back +Given an integer n, return true if it is possible to represent n as the sum of distinct powers of three. Otherwise, return false. + +* LC 1851. Minimum Interval to Include Each Query — what does it ask? :leetcode:hard:intervals:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1851 *Minimum Interval to Include Each Query* ask you to do? +** Back +You are given a 2D integer array intervals, where intervals[i] [left{i}, right{i}] describes the i^{th} interval starting at left{i} and ending at right{i} (inclusive). The size of an interval is defined as the number of integers it contains, or more formally right{i} - left{i} + 1. + +* LC 1863. Sum of All Subsets XOR Total — what does it ask? :leetcode:easy:backtracking:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1863 *Sum of All Subsets XOR Total* ask you to do? +** Back +Write your approach here. + +* LC 1871. Jump Game VII — what does it ask? :leetcode:medium:greedy:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1871 *Jump Game VII* ask you to do? +** Back +You are given a 0-indexed binary string s and two integers minJump and maxJump. In the beginning, you are standing at index 0, which is equal to '0'. You can move from index i to index j if the following conditions are fulfilled: + +* LC 1899. Merge Triplets to Form Target Triplet — what does it ask? :leetcode:medium:greedy:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1899 *Merge Triplets to Form Target Triplet* ask you to do? +** Back +A triplet is an array of three integers. You are given a 2D integer array triplets, where triplets[i] [a{i}, b{i}, c{i}] describes the i^{th} triplet. You are also given an integer array target [x, y, z] that describes the triplet you want to obtain. + +* LC 1905. Count Sub Islands — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1905 *Count Sub Islands* ask you to do? +** Back +You are given two m x n binary matrices grid1 and grid2 containing only 0's (representing water) and 1's (representing land). An island is a group of 1's connected 4-directionally (horizontal or vertical). Any cells outside of the grid are considered water cells. + +* LC 1911. Maximum Alternating Subsequence Sum — what does it ask? :leetcode:medium:2d-dp:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 1911 *Maximum Alternating Subsequence Sum* ask you to do? +** Back +The alternating sum of a 0-indexed array is defined as the sum of the elements at even indices minus the sum of the elements at odd indices. + +* LC 2013. Detect Squares — what does it ask? :leetcode:medium:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 2013 *Detect Squares* ask you to do? +** Back +You are given a stream of points on the X-Y plane. Design an algorithm that: + +* LC 2092. Find All People With Secret — what does it ask? :leetcode:hard:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 2092 *Find All People With Secret* ask you to do? +** Back +You are given an integer n indicating there are n people numbered from 0 to n - 1. You are also given a 0-indexed 2D integer array meetings where meetings[i] [x{i}, y{i}, time{i}] indicates that person x{i} and person y{i} have a meeting at time{i}. A person may attend multiple meetings at the same time. Finally, you are given an integer firstPerson. + +* LC 2220. Minimum Bit Flips to Convert Number — what does it ask? :leetcode:easy:bit-manipulation:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 2220 *Minimum Bit Flips to Convert Number* ask you to do? +** Back +A bit flip of a number x is choosing a bit in the binary representation of x and flipping it from either 0 to 1 or 1 to 0. + +* LC 2300. Successful Pairs of Spells and Potions — what does it ask? :leetcode:medium:binary-search:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 2300 *Successful Pairs of Spells and Potions* ask you to do? +** Back +You are given two positive integer arrays spells and potions, of length n and m respectively, where spells[i] represents the strength of the i^{th} spell and potions[j] represents the strength of the j^{th} potion. + +* LC 2326. Spiral Matrix IV — what does it ask? :leetcode:medium:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 2326 *Spiral Matrix IV* ask you to do? +** Back +You are given two integers m and n, which represent the dimensions of a matrix. + +* LC 2487. Remove Nodes From Linked List — what does it ask? :leetcode:medium:linked-list:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 2487 *Remove Nodes From Linked List* ask you to do? +** Back +You are given the head of a linked list. + +* LC 2493. Divide Nodes Into the Maximum Number of Groups — what does it ask? :leetcode:hard:advanced-graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 2493 *Divide Nodes Into the Maximum Number of Groups* ask you to do? +** Back +You are given a positive integer n representing the number of nodes in an undirected graph. The nodes are labeled from 1 to n. + +* LC 2658. Maximum Number of Fish in a Grid — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 2658 *Maximum Number of Fish in a Grid* ask you to do? +** Back +You are given a 0-indexed 2D matrix grid of size m x n, where (r, c) represents: + +* LC 2678. Number of Senior Citizens — what does it ask? :leetcode:easy:arrays-&-hashing:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 2678 *Number of Senior Citizens* ask you to do? +** Back +You are given a 0-indexed array of strings details. Each element of details provides information about a given passenger compressed into a string of length 15. The system is such that: + +* LC 2698. Find the Punishment Number of an Integer — what does it ask? :leetcode:medium:math-&-geometry:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 2698 *Find the Punishment Number of an Integer* ask you to do? +** Back +Given a positive integer n, return the punishment number of n. + +* LC 2812. Find the Safest Path in a Grid — what does it ask? :leetcode:medium:advanced-graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 2812 *Find the Safest Path in a Grid* ask you to do? +** Back +You are given a 0-indexed 2D matrix grid of size n x n, where (r, c) represents: + +* LC 2924. Find Champion II — what does it ask? :leetcode:medium:graphs:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 2924 *Find Champion II* ask you to do? +** Back +There are n teams numbered from 0 to n - 1 in a tournament; each team is also a node in a DAG. + +* LC 3306. Count of Substrings Containing Every Vowel and K Consonants II — what does it ask? :leetcode:medium:sliding-window:retrieval::recognition: +:PROPERTIES: +:ANKI_NOTE_TYPE: Basic +:END: +** Front +What does LeetCode 3306 *Count of Substrings Containing Every Vowel and K Consonants II* ask you to do? +** Back +You are given a string word and a non-negative integer k.