0% found this document useful (0 votes)
40 views

Problems

This document lists over 50 coding problems categorized by data structure and algorithm type, including arrays, hash tables, recursion, linked lists, stacks, queues, trees, graphs, and dynamic programming. Many problems are drawn from LeetCode and involve topics such as two sum, subsets, strings, sorting, searching, binary trees, and graph traversal.

Uploaded by

Tung Vu
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Problems

This document lists over 50 coding problems categorized by data structure and algorithm type, including arrays, hash tables, recursion, linked lists, stacks, queues, trees, graphs, and dynamic programming. Many problems are drawn from LeetCode and involve topics such as two sum, subsets, strings, sorting, searching, binary trees, and graph traversal.

Uploaded by

Tung Vu
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 39

Problem Array

Class photos x2 Array


Squares of a sorted array x2 Array
Monotonic Array x2 Array
Closest value in BST x2 Array

Rotate Array x2 Array


Container With Most Water Array
Two Sum Array, Hash table
Best Time to Buy and Sell Stock Array
Contains Duplicate Array
Product of Array Except Self Array
Maximum Subarray Array

Maximum Product Subarray Array


Find minimum in rotated array Array
Search in rotated sorted array Array
Three Sum Array

Isomorphic Strings Hash table


Ransom Note Hash table
Group Anagrams Hash table, String
Insert Delete GetRandom O(1) Hash table
First Missing Positive Array, Hash table

Fibonacci Number Recursion


Power Sum Recursion
Permutations Recursion
Subsets Recursion
Sum of All Subset XOR Totals Recursion
Binary Tree Paths Recursion

Generate Parentheses Recursion


Combinations Recursion
Letter Combinations of a Phone Number Recursion
Subsets 2 Recursion
First Unique Character in a String String
Valid Palindrome String
Top K Frequent Elements Hash table, bucket sort
Valid Anagram Array, String

Longest Substring Without Repeating Characters String, Hash table


Valid Sudoku Array
Longest Consecutive Sequence Array
Encode and Decode Strings Array

Two Sum II - Input Array Is Sorted Array


Valid Parentheses Stack
Min Stack x2 Stack
Daily Temperatures Stack
Evaluate Reverse Polish Notation Stack

Car Fleet Stack


Binary Search Binary search
Search a 2D Matrix Binary search
Koko Eating Bananas Binary search
Time Based Key-Value Store Binary search
Best Time to Buy and Sell Stock Sliding window

Sort Colors Sorting, two pointers


Insertion Sort x2 Sorting
Longest Repeating Character Replacement Sliding window
Permutation in String Sliding window

Reverse Linked List x3 Linked list


Linked List Cycle Linked list
Merge Two Sorted Lists x2 Linked list
Reorder List Linked list
Remove Nth Node From End of List Linked list
Add Two Numbers Linked list
Find the Duplicate Number Array
LRU Cache Linked list
Copy List with Random Pointer Linked list
Maximum Depth of Binary Tree Binary tree
Binary Tree Inorder Traversal Binary tree
Binary Tree Preorder Traversal Binary tree
Binary Tree Postorder Traversal Binary tree
Invert Binary Tree Binary tree
Lowest Common Ancestor of a Binary Search Tree x2 Binary search tree
Diameter of Binary Tree Binary tree
Balanced Binary Tree Binary tree
Same Tree Binary tree
Subtree of Another Tree Binary tree

Binary Tree Level Order Traversal Binary tree


Binary Tree Right Side View Binary tree
Count Good Nodes in Binary Tree Binary tree
Validate Binary Search Tree Binary tree
Kth Smallest Element in a BST Binary tree
Construct Binary Tree from Preorder and Inorder Traversal Binary tree

Word Search Backtracking, DFS

Unique Paths Dynamic


Combination Sum Backtracking, DFS
Combination Sum II Backtracking, DFS

Search in a Binary Search Tree Binary search tree


Insert into a Binary Search Tree Binary search tree
Delete Node in a BST Binary search tree
Remove Duplicates from Sorted Array Array
Shuffle the Array Array
Concatenation of Array Array
Baseball Game Stack
Design Linked List Queue

Design Browser History Array

Number of Students Unable to Eat Lunch Array, Stack


Implement Stack using Queues Array
Climbing Stairs Recursion
Container With Most Water Array
Maximum Subarray Array

Maximum Product Subarray Array


Search in rotated sorted array Array
Three Sum Array
Find minimum in rotated array Array
Isomorphic Strings Hash table

Ransom Note Hash table


Group Anagrams Hash table, String
Insert Delete GetRandom O(1) Hash table

First Missing Positive Array, Hash table


Top K Frequent Elements Hash table, bucket sort
Product of Array Except Self Array
Valid Sudoku Array

Longest Consecutive Sequence Array


Encode and Decode Strings Array

Trapping Rain Water Array, Two pointers

Longest Substring Without Repeating Characters String, Hash table


Longest Repeating Character Replacement Sliding window

Maximum Points You Can Obtain from Cards Array


Link
Algo expert
https://leetcode.com/problems/squares-of-a-sorted-array
https://leetcode.com/problems/monotonic-array/
Algo expert

https://leetcode.com/problems/rotate-array/
https://leetcode.com/problems/container-with-most-water/
https://leetcode.com/problems/two-sum/
https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
https://leetcode.com/problems/contains-duplicate/
https://leetcode.com/problems/product-of-array-except-self/
https://leetcode.com/problems/maximum-subarray/

https://leetcode.com/problems/maximum-product-subarray/
https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/
https://leetcode.com/problems/search-in-rotated-sorted-array/
https://leetcode.com/problems/3sum/

https://leetcode.com/problems/isomorphic-strings/
https://leetcode.com/problems/ransom-note/
https://leetcode.com/problems/group-anagrams/
https://leetcode.com/problems/insert-delete-getrandom-o1/
https://leetcode.com/problems/first-missing-positive/

https://leetcode.com/problems/fibonacci-number/
Master Coding Interview Data structures + Algorithms
https://leetcode.com/problems/permutations/
https://leetcode.com/problems/subsets/
https://leetcode.com/problems/sum-of-all-subset-xor-totals/
https://leetcode.com/problems/binary-tree-paths/

https://leetcode.com/problems/generate-parentheses/
https://leetcode.com/problems/combinations/
https://leetcode.com/problems/letter-combinations-of-a-phone-number/
https://leetcode.com/problems/subsets-ii/
https://leetcode.com/problems/first-unique-character-in-a-string/
https://leetcode.com/problems/valid-palindrome/
https://leetcode.com/problems/top-k-frequent-elements/
https://leetcode.com/problems/valid-anagram/

https://leetcode.com/problems/longest-substring-without-repeating-characters/
https://leetcode.com/problems/valid-sudoku/description/
https://leetcode.com/problems/longest-consecutive-sequence/
https://leetcode.com/problems/encode-and-decode-strings/

https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/
https://leetcode.com/problems/valid-parentheses/
https://leetcode.com/problems/min-stack/
https://leetcode.com/problems/daily-temperatures/
https://leetcode.com/problems/evaluate-reverse-polish-notation/

https://leetcode.com/problems/car-fleet/
https://leetcode.com/problems/binary-search/
https://leetcode.com/problems/search-a-2d-matrix/
https://leetcode.com/problems/koko-eating-bananas/
https://leetcode.com/problems/time-based-key-value-store/
https://leetcode.com/problems/best-time-to-buy-and-sell-stock/

https://leetcode.com/problems/sort-colors/
Master Coding Interview Data structures + Algorithms
https://leetcode.com/problems/longest-repeating-character-replacement/
https://leetcode.com/problems/permutation-in-string/

https://leetcode.com/problems/reverse-linked-list/
https://leetcode.com/problems/linked-list-cycle/
https://leetcode.com/problems/merge-two-sorted-lists/
https://leetcode.com/problems/reorder-list/
https://leetcode.com/problems/remove-nth-node-from-end-of-list/
https://leetcode.com/problems/add-two-numbers/
https://leetcode.com/problems/find-the-duplicate-number/
https://leetcode.com/problems/lru-cache/
https://leetcode.com/problems/copy-list-with-random-pointer/
https://leetcode.com/problems/maximum-depth-of-binary-tree/
https://leetcode.com/problems/binary-tree-inorder-traversal/
https://leetcode.com/problems/binary-tree-preorder-traversal/
https://leetcode.com/problems/binary-tree-postorder-traversal/
https://leetcode.com/problems/invert-binary-tree/
https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/
https://leetcode.com/problems/diameter-of-binary-tree/
https://leetcode.com/problems/balanced-binary-tree/
https://leetcode.com/problems/same-tree/description/
https://leetcode.com/problems/subtree-of-another-tree/

https://leetcode.com/problems/binary-tree-level-order-traversal/
https://leetcode.com/problems/binary-tree-right-side-view/
https://leetcode.com/problems/count-good-nodes-in-binary-tree/
https://leetcode.com/problems/validate-binary-search-tree/
https://leetcode.com/problems/kth-smallest-element-in-a-bst/
https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/

https://leetcode.com/problems/word-search/

https://leetcode.com/problems/unique-paths/
https://leetcode.com/problems/combination-sum/
https://leetcode.com/problems/combination-sum-ii/

https://leetcode.com/problems/search-in-a-binary-search-tree/
https://leetcode.com/problems/insert-into-a-binary-search-tree/
https://leetcode.com/problems/delete-node-in-a-bst/
https://leetcode.com/problems/remove-duplicates-from-sorted-array/
https://leetcode.com/problems/shuffle-the-array/
https://leetcode.com/problems/concatenation-of-array/
https://leetcode.com/problems/baseball-game/
https://leetcode.com/problems/design-linked-list/description/

https://leetcode.com/problems/design-browser-history/

https://leetcode.com/problems/number-of-students-unable-to-eat-lunch/
https://leetcode.com/problems/implement-stack-using-queues/
https://leetcode.com/problems/climbing-stairs/
https://leetcode.com/problems/container-with-most-water/
https://leetcode.com/problems/maximum-subarray/

https://leetcode.com/problems/maximum-product-subarray/
https://leetcode.com/problems/search-in-rotated-sorted-array/
https://leetcode.com/problems/3sum/
https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/
https://leetcode.com/problems/isomorphic-strings/

https://leetcode.com/problems/ransom-note/
https://leetcode.com/problems/group-anagrams/
https://leetcode.com/problems/insert-delete-getrandom-o1/

https://leetcode.com/problems/first-missing-positive/
https://leetcode.com/problems/top-k-frequent-elements/
https://leetcode.com/problems/product-of-array-except-self/
https://leetcode.com/problems/valid-sudoku/description/

https://leetcode.com/problems/longest-consecutive-sequence/
https://leetcode.com/problems/encode-and-decode-strings/

https://leetcode.com/problems/trapping-rain-water/description/

https://leetcode.com/problems/longest-substring-without-repeating-characters/
https://leetcode.com/problems/longest-repeating-character-replacement/

https://leetcode.com/problems/maximum-points-you-can-obtain-from-cards/submissions/946091234/
determine which row should be behind and which row should be first, com
using two pointers technique one from left and one from right, square, co
using one loop and determine if the array is increasing or decreasing
similar to binary search

using reverse with a trick multiple times


using two pointers left and right. Max area = left*right. Determind should

using a dictionary to check if the element has appeared


creates two arrays by time each element in the array
looping through the array and use two variables max and currentSum

loop through the given arr and using two running variables (max, min)
using binary search algorithm to find rotated part, find min in it
check if which part is sorted and which contains the target
pick a number and find other two by two sum || using three pointers (per

using two dictionaries to check the condition that no 2 characters can map
using dictionary
using dictionary with [Int] as key, also using asciiValue
use an arr and a dictionary, the hard part is the remove method, pop last i
n in [1…arr.count+1], turn the original arr into a lookup array where if n ex

using bucket sort to be optimized

use two pointers running from left to right, check the current substring co
using hash table for rows, cols, squares, looping throught the board and ch
iterate through the set, check where to start the sequence
count how many characters on each string + #

using two separated arrays (stack & minStack), minStack keeps track of mi
Solution is not optimized

using sliding window and hash table to count most frequent characters in
using sliding window and hash table to count s1 characters, count down o
Day 11, 12, 13 (Sat, Sun, Mon) Off
Day 14 using prev, cur, next pointers to swap the next || using array to store all th
Using two pointers running from left to the end
using two pointers on each list, compare and merge
using fast and slow pointers, reverse the second half and merge with the fi
store all the nodes in an array, check corner cases
Day 15 straight-forward problem, travel and sum from left to right
using an array of integers from 1 to n, loop through the given array and co
using a doubly linked list and a hash table and of [key: Node]
using a hash-table of [Node: Node]
Day 16

Day 17 Check root node with p & q if rather q&p are in the same tree (subtree) or
*

Day 18 (SAT) Off


Day 19 keeping track of which level where traveling
Maintaining an array contains all nodes in a level
Keeping track of the largest value so far from root to a child node
Keeping track of lower and upper limit
Pushing all the nodes in an array in in-order traversal so the array will be a
Day 20 *
Day 21
Day 22
Thailand trip off
Day 23

Using recursion
using two pointers for optimze solution

using doubly linked list, the idea is simple but the implementation is a bit c

using an array

using two pointers left and right. Max area = left*right. Determind should
looping through the array and use two variables max and currentSum

loop through the given arr and using two running variables (max, min)
check if which part is sorted and which contains the target
pick a number and find other two by two sum || using three pointers (per
using binary search algorithm to find rotated part, find min in it
using two dictionaries to check the condition that no 2 characters can map

using dictionary
using dictionary with [Int] as key, also using asciiValue
use an arr and a dictionary, the hard part is the remove method, pop last i

n in [1…arr.count+1], turn the original arr into a lookup array where if n ex


using bucket sort to be optimized
creates two arrays by time each element in the array
using hash table for rows, cols, squares, looping throught the board and ch

iterate through the set, check where to start the sequence


count how many characters on each string + # to encode

calculate how much water can be trapped at each position using fomular m

use two pointers running from left to right, check the current substring co
* using sliding window and hash table to count most frequent characters in

ns/946091234/
d which row should be first, compare each pair from those two rows to see if it match the condition
ft and one from right, square, compare and swap
is increasing or decreasing

= left*right. Determind should we go with left+1 or right-1

has appeared
n the array
iables max and currentSum

unning variables (max, min)


ed part, find min in it
ntains the target
um || using three pointers (perferred)

on that no 2 characters can map to the same character

g asciiValue
s the remove method, pop last is O(1)
nto a lookup array where if n existed in arr, arr[n-1] < 0

, check the current substring contains repeated character, if yes remove it from dictionary
oping throught the board and check if the element is valid
art the sequence

ack), minStack keeps track of minimum elements

unt most frequent characters in the window & check conditon where windowLength - mostFrequent <= k
unt s1 characters, count down on s2

next || using array to store all the nodes (faster) || recursion

econd half and merge with the first half

from left to right


p through the given array and compare with the array was created to see if an integer is duplicated
and of [key: Node]

are in the same tree (subtree) or in different subtree

om root to a child node


er traversal so the array will be accendannt ordered

but the implementation is a bit complicated

= left*right. Determind should we go with left+1 or right-1


iables max and currentSum

unning variables (max, min)


ntains the target
um || using three pointers (perferred)
ed part, find min in it
on that no 2 characters can map to the same character

g asciiValue
s the remove method, pop last is O(1)

nto a lookup array where if n existed in arr, arr[n-1] < 0

n the array
oping throught the board and check if the element is valid

art the sequence


+ # to encode

at each position using fomular min(maxLeft, maxRight) - height[i]

, check the current substring contains repeated character, if yes remove it from dictionary
unt most frequent characters in the window & check conditon where windowLength - mostFrequent <= k
equent <= k
equent <= k
A BETTER VERSION ->> https://neetcode.io/
Video Solution Category
https://youtu.be/KLlXCFG5TnA Arrays
https://youtu.be/1pkOgXD63yU Arrays
https://youtu.be/3OamzN90kPg Arrays
https://youtu.be/bNvIQI2wAjk Arrays
https://youtu.be/5WZl3MMT0Eg Arrays
https://youtu.be/lXVy6YWFcRM Arrays
https://youtu.be/nIVW4P8b1VA Arrays
https://youtu.be/U8XENwh8Oy8 Arrays
https://youtu.be/jzZsG8n2R9A Arrays
https://youtu.be/UuiTKBwPgAo Arrays
https://youtu.be/gVUrDV4tZfY Binary
https://youtu.be/5Km3utixwZs Binary
https://youtu.be/RyBM56RIWrM Binary
https://youtu.be/WnPLSRLSANE Binary
https://youtu.be/UcoN6UjAI64 Binary
https://youtu.be/Y0lT9Fck7qI Dynamic Programming
https://youtu.be/H9bfqozjoqs Dynamic Programming
https://youtu.be/cjWnW0hdF1Y Dynamic Programming
https://youtu.be/Ua0GhsJSlWM Dynamic Programming
https://youtu.be/Sx9NNgInc3A Dynamic Programming
https://youtu.be/GBKI9VSKdGg Dynamic Programming
https://youtu.be/73r3KWiEvyk Dynamic Programming
https://youtu.be/rWAJCfYYOvM Dynamic Programming
https://youtu.be/6aEyTjOwlJU Dynamic Programming
https://youtu.be/IlEsdxuD4lY Dynamic Programming
https://youtu.be/Yan0cv2cLy8 Dynamic Programming
https://youtu.be/mQeF6bN8hMk Graph
https://youtu.be/EgI5nU9etnU Graph
https://youtu.be/s-VkcjHqkGI Graph
https://youtu.be/pV2kpPD66nE Graph
https://youtu.be/P6RZZMu_maU Graph
https://youtu.be/6kTZYvNNyps Graph
https://youtu.be/bXsUuownnoQ Graph
https://youtu.be/8f1XPm4WOUc Graph
https://youtu.be/A8NUOmlwOlM Interval
https://youtu.be/44H3cEC2fFM Interval
https://youtu.be/nONCGxWoUfM Interval
https://youtu.be/PaJxqZVPhbg Interval
https://youtu.be/FdzJmTCVyJU Interval
https://youtu.be/G0_I-ZF0S38 Linked List
https://youtu.be/gBTe7lFR3vc Linked List
https://youtu.be/XIdigk956u0 Linked List
https://youtu.be/q5a5OiGbT6Q Linked List
https://youtu.be/XVuQxVej6y8 Linked List
https://youtu.be/S5bfdUTrKLM Linked List
https://youtu.be/T41rL0L3Pnw Matrix
https://youtu.be/BJnMZNwUk1M Matrix
https://youtu.be/fMSJSS7eO1w Matrix
https://youtu.be/pfiQ_PS1g8E Matrix
https://youtu.be/wiGpQwVHdE0 String
https://youtu.be/gqXU1UyA8pk String
https://youtu.be/jSto0O4AJbM String
https://youtu.be/9UtInBqnCgA String
https://youtu.be/vzdNOK2oB2E String
https://youtu.be/WTzjTskDFMg String
https://youtu.be/jJXJ16kPFWg String
https://youtu.be/XYQecbcd6_c String
https://youtu.be/4RACzI5-du8 String
https://youtu.be/B1k_sxOSgv8 String
https://youtu.be/hTM3phVI6YQ Tree
https://youtu.be/vRbbcKXCxOw Tree
https://youtu.be/OnSn2XEQ4MY Tree
https://youtu.be/Hr5cWUld4vU Tree
https://youtu.be/6ZnyEApgFYg Tree
https://youtu.be/u4JAi2JJhI8 Tree
https://youtu.be/E36O5SWp-LE Tree
https://youtu.be/ihj4IQGZ2zc Tree
https://youtu.be/s6ATEkipzow Tree
https://youtu.be/5LUXSvjmGCw Tree
https://youtu.be/gs2LMfuOR9k Tree
https://youtu.be/oobqoCJlHA0 Tree
https://youtu.be/BTf05gs_8iU Tree
https://youtu.be/asbcE9mZz_U Tree
https://youtu.be/q5a5OiGbT6Q Heap
https://youtu.be/YPTqKIgVk-k Heap
https://youtu.be/itmhHWaHupI Heap
Name
Two Sum
Best Time to Buy and Sell Stock
Contains Duplicate
Product of Array Except Self
Maximum Subarray
Maximum Product Subarray
Find Minimum in Rotated Sorted Array
Search in Rotated Sorted Array
3Sum
Container With Most Water
Sum of Two Integers
Number of 1 Bits
Counting Bits
Missing Number
Reverse Bits
Climbing Stairs
Coin Change
Longest Increasing Subsequence
Longest Common Subsequence
Word Break Problem
Combination Sum
House Robber
House Robber II
Decode Ways
Unique Paths
Jump Game
Clone Graph
Course Schedule
Pacific Atlantic Water Flow
Number of Islands
Longest Consecutive Sequence
Alien Dictionary (Leetcode Premium)
Graph Valid Tree (Leetcode Premium)
Number of Connected Components in an Undirected Graph
Insert Interval
Merge Intervals
Non-overlapping Intervals
Meeting Rooms (Leetcode Premium)
Meeting Rooms II (Leetcode Premium)
Reverse a Linked List
Detect Cycle in a Linked List
Merge Two Sorted Lists
Merge K Sorted Lists
Remove Nth Node From End Of List
Reorder List
Set Matrix Zeroes
Spiral Matrix
Rotate Image
Word Search
Longest Substring Without Repeating Characters
Longest Repeating Character Replacement
Minimum Window Substring
Valid Anagram
Group Anagrams
Valid Parentheses
Valid Palindrome
Longest Palindromic Substring
Palindromic Substrings
Encode and Decode Strings (Leetcode Premium)
Maximum Depth of Binary Tree
Same Tree
Invert/Flip Binary Tree
Binary Tree Maximum Path Sum
Binary Tree Level Order Traversal
Serialize and Deserialize Binary Tree
Subtree of Another Tree
Construct Binary Tree from Preorder and Inorder Traversal
Validate Binary Search Tree
Kth Smallest Element in a BST
Lowest Common Ancestor of BST
Implement Trie (Prefix Tree)
Add and Search Word
Word Search II
Merge K Sorted Lists
Top K Frequent Elements
Find Median from Data Stream
Link
https://leetcode.com/problems/two-sum/
https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
https://leetcode.com/problems/contains-duplicate/
https://leetcode.com/problems/product-of-array-except-self/
https://leetcode.com/problems/maximum-subarray/
https://leetcode.com/problems/maximum-product-subarray/
https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/
https://leetcode.com/problems/search-in-rotated-sorted-array/
https://leetcode.com/problems/3sum/
https://leetcode.com/problems/container-with-most-water/
https://leetcode.com/problems/sum-of-two-integers/
https://leetcode.com/problems/number-of-1-bits/
https://leetcode.com/problems/counting-bits/
https://leetcode.com/problems/missing-number/
https://leetcode.com/problems/reverse-bits/
https://leetcode.com/problems/climbing-stairs/
https://leetcode.com/problems/coin-change/
https://leetcode.com/problems/longest-increasing-subsequence/
https://leetcode.com/problems/longest-common-subsequence/
https://leetcode.com/problems/word-break/
https://leetcode.com/problems/combination-sum/
https://leetcode.com/problems/house-robber/
https://leetcode.com/problems/house-robber-ii/
https://leetcode.com/problems/decode-ways/
https://leetcode.com/problems/unique-paths/
https://leetcode.com/problems/jump-game/
https://leetcode.com/problems/clone-graph/
https://leetcode.com/problems/course-schedule/
https://leetcode.com/problems/pacific-atlantic-water-flow/
https://leetcode.com/problems/number-of-islands/
https://leetcode.com/problems/longest-consecutive-sequence/
https://leetcode.com/problems/alien-dictionary/
https://leetcode.com/problems/graph-valid-tree/
https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/
https://leetcode.com/problems/insert-interval/
https://leetcode.com/problems/merge-intervals/
https://leetcode.com/problems/non-overlapping-intervals/
https://leetcode.com/problems/meeting-rooms/
https://leetcode.com/problems/meeting-rooms-ii/
https://leetcode.com/problems/reverse-linked-list/
https://leetcode.com/problems/linked-list-cycle/
https://leetcode.com/problems/merge-two-sorted-lists/
https://leetcode.com/problems/merge-k-sorted-lists/
https://leetcode.com/problems/remove-nth-node-from-end-of-list/
https://leetcode.com/problems/reorder-list/
https://leetcode.com/problems/set-matrix-zeroes/
https://leetcode.com/problems/spiral-matrix/
https://leetcode.com/problems/rotate-image/
https://leetcode.com/problems/word-search/
https://leetcode.com/problems/longest-substring-without-repeating-characters/
https://leetcode.com/problems/longest-repeating-character-replacement/
https://leetcode.com/problems/minimum-window-substring/
https://leetcode.com/problems/valid-anagram/
https://leetcode.com/problems/group-anagrams/
https://leetcode.com/problems/valid-parentheses/
https://leetcode.com/problems/valid-palindrome/
https://leetcode.com/problems/longest-palindromic-substring/
https://leetcode.com/problems/palindromic-substrings/
https://leetcode.com/problems/encode-and-decode-strings/
https://leetcode.com/problems/maximum-depth-of-binary-tree/
https://leetcode.com/problems/same-tree/
https://leetcode.com/problems/invert-binary-tree/
https://leetcode.com/problems/binary-tree-maximum-path-sum/
https://leetcode.com/problems/binary-tree-level-order-traversal/
https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
https://leetcode.com/problems/subtree-of-another-tree/
https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
https://leetcode.com/problems/validate-binary-search-tree/
https://leetcode.com/problems/kth-smallest-element-in-a-bst/
https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/
https://leetcode.com/problems/implement-trie-prefix-tree/
https://leetcode.com/problems/add-and-search-word-data-structure-design/
https://leetcode.com/problems/word-search-ii/
https://leetcode.com/problems/merge-k-sorted-lists/
https://leetcode.com/problems/top-k-frequent-elements/
https://leetcode.com/problems/find-median-from-data-stream/
Notes
use hash map to instantly check for difference value, map will add index of last occurrence of a num
find local min and search for local max, sliding window;
hashset to get unique values in array, to check for duplicates easily
make two passes, first in-order, second in-reverse, to compute products
pattern: prev subarray cant be negative, dynamic programming: compute max sum for each prefix
dp: compute max and max-abs-val for each prefix subarr;
check if half of array is sorted in order to find pivot, arr is guaranteed to be in at most two sorted su
at most two sorted halfs, mid will be apart of left sorted or right sorted, if target is in range of sorte
sort input, for each first element, find next two where -a = b+c, if a=prevA, skip a, if b=prevB skip b
shrinking window, left/right initially at endpoints, shift the pointer with min height;
add bit by bit, be mindful of carry, after adding, if carry is still 1, then add it as well;
modulo, and dividing n; mod and div are expensive, to divide use bit shift, instead of mod to get 1's
write out result for num=16 to figure out pattern; res[i] = res[i - offset], where offset is the biggest p
compute expected sum - real sum; xor n with each index and value;
reverse each of 32 bits;
subproblem find (n-1) and (n-2), sum = n;
top-down: recursive dfs, for amount, branch for each coin, cache to store prev coin_count for each
recursive: foreach num, get subseq with num and without num, only include num if prev was less, c
recursive: if first chars are equal find lcs of remaining of each, else max of: lcs of first and remain of
for each prefix, if prefix is in dict and wordbreak(remaining str)=True, then return True, cache resul
visualize the decision tree, base case is curSum = or > target, each candidate can have children of it
for each num, get max of prev subarr, or num + prev subarr not including last element, store result
subarr = arr without first & last, get max of subarr, then pick which of first/last should be added to
can cur char be decoded in one or two ways? Recursion -> cache -> iterative dp solution, a lot of ed
work backwards from solution, store paths for each position in grid, to further optimize, we don’t s
visualize the recursive tree, cache solution for O(n) time/mem complexity, iterative is O(1) mem, ju
recursive dfs, hashmap for visited nodes
build adjacentcy_list with edges, run dfs on each V, if while dfs on V we see V again, then loop exist
dfs each cell, keep track of visited, and track which reach pac, atl; dfs on cells adjacent to pac, atl, fi
foreach cell, if cell is 1 and unvisited run dfs, increment cound and marking each contigous 1 as visi
use bruteforce and try to optimize, consider the max subseq containing each num; add each num t
chars of a word not in order, the words are in order, find adjacency list of each unique char by itera
union find, if union return false, loop exists, at end size must equal n, or its not connected; dfs to ge
dfs on each node that hasn’t been visited, increment component count, adjacency list; bfs and unio
insert new interval in order, then merge intervals; newinterval could only merge with one interval t
sort each interval, overlapping intervals should be adjacent, iterate and build solution; also graph m
instead of removing, count how max num of intervals you can include, sort intervals, dp to comput
sort intervals by start time, if second interval doesn’t overlap with first, then third def wont overlap
we care about the points in time where we are starting/ending a meeting, we already are given tho
iterate through maintaining cur and prev; recursively reverse, return new head of list
dict to remember visited nodes; two pointers at different speeds, if they meet there is loop
insert each node from one list into the other
divied and conquer, merge lists, N totalnodes, k-lists, O(N*logk). For each list, find min val, insert it
use dummy node at head of list, compute len of list; two pointers, second has offset of n from first;
reverse second half of list, then easily reorder it; non-optimal way is to store list in array;
use sets to keep track of all rows, cols to zero out, after, for each num if it is in a zero row or col the
keep track of visited cells; keep track of boundaries, layer-by-layer;
rotate layer-by-layer, use that it's a square as advantage, rotate positions in reverse order, store a i
dfs on each cell, for each search remember visited cells, and remove cur visited cell right before yo
sliding window, if we see same char twice within curr window, shift start position;
PAY ATTENTION: limited to chars A-Z; for each capital char, check if it could create the longest repe
need is num of unique char in T, HAVE is num of char we have valid count for, sliding window, mov
hashmap to count each char in str1, decrement for str2;
for each of 26 chars, use count of each char in each word as tuple for key in dict, value is the list of
push opening brace on stack, pop if matching close brace, at end if stack empty, return true;
left, right pointers, update left and right until each points at alphanum, compare left and right, con
foreach char in str, consider it were the middle, consider if pali was odd or even;
same as longest palindromic string, each char in str as middle and expand outwards, do same for p
store length of str before each string and delimiter like '#';
recursive dfs to find max-depth of subtrees; iterative bfs to count number of levels in tree
recursive dfs on both trees at the same time; iterative bfs compare each level of both trees
recursive dfs to invert subtrees; bfs to invert levels, use collections.deque; iterative dfs is easy with
helper returns maxpathsum without splitting branches, inside helper we also update maxSum by co
iterative bfs, add prev level which doesn't have any nulls to the result;
bfs every single non-null node is added to string, and it's children are added too, even if they're nul
traverse s to check if any subtree in s equals t; merkle hashing?
first element in pre-order is root, elements left of root in in-order are left subtree, right of root are
trick is use built in python min/max values float("inf"), "-inf", as parameters; iterative in-order trave
non-optimal store tree in sorted array; iterative dfs in-order and return the kth element processed,
compare p, q values to curr node, base case: one is in left, other in right subtree, then curr is lca;
node has children characters, and bool if its an ending character, node DOESN’T have or need char,
if char = "." run search for remaining portion of word on all of curr nodes children;
trick: I though use trie to store the grid, reverse thinking, instead store dictionary words, dfs on eac
we always want the min of the current frontier, we can store frontier in heap of size k for efficient p
minheap that’s kept at size k, if its bigger than k pop the min, by the end it should be left with k larg
maintain curr median, and all num greater than med in a minHeap, and all num less than med in a
ex of last occurrence of a num, don’t use same element twice;

ute max sum for each prefix

o be in at most two sorted subarrays


d, if target is in range of sorted portion then search it, otherwise search other half
evA, skip a, if b=prevB skip b to elim duplicates; to find b,c use two pointers, left/right on remaining list;
h min height;
dd it as well;
hift, instead of mod to get 1's place use bitwise & 1;
, where offset is the biggest power of 2 <= I;

ore prev coin_count for each amount; bottom-up: compute coins for amount = 1, up until n, using for each c
nclude num if prev was less, cache solution of each; dp=subseq length which must end with each num, curr n
x of: lcs of first and remain of 2nd and lcs of 2nd remain of first, cache result; nested forloop to compute the
then return True, cache result of wordbreak;
didate can have children of itself or elements to right of it inorder to elim duplicate solutions;
ing last element, store results of prev, and prev not including last element
first/last should be added to it
rative dp solution, a lot of edge cases to determine, 52, 31, 29, 10, 20 only decoded one way, 11, 26 decoded
further optimize, we don’t store whole grid, only need to store prev row;
xity, iterative is O(1) mem, just iterate backwards to see if element can reach goal node, if yes, then set it eq

e see V again, then loop exists, otherwise V isnt in a loop, 3 states= not visited, visited, still visiting
on cells adjacent to pac, atl, find overlap of cells that are visited by both pac and atl cells;
rking each contigous 1 as visited
g each num; add each num to hashset, for each num if num-1 doesn’t exist, count the consecutive nums afte
t of each unique char by iterating through adjacent words and finding first chars that are different, run topso
or its not connected; dfs to get size and check for loop, since each edge is double, before dfs on neighbor of N
t, adjacency list; bfs and union find are possible;
nly merge with one interval that comes before it, then add remaining intervals;
d build solution; also graph method, less efficient, more complicated
sort intervals, dp to compute max intervals up until the i-th interval;
, then third def wont overlap with first;
ting, we already are given those, just separate start/end and traverse counting num of meetings going at the
ew head of list
ey meet there is loop

ach list, find min val, insert it into list, use priorityQ to optimize finding min O(N*logk)
ond has offset of n from first;
o store list in array;
if it is in a zero row or col then change it to 0; flag first cell in row, and col to mark row/col that needs to be z

ons in reverse order, store a in temp, a = b, b = c, c = d, d = temp;


ur visited cell right before you return from dfs;
art position;
could create the longest repeating substr, use sliding window to optimize; check if windowlen=1 works, if yes
unt for, sliding window, move right until valid, if valid, increment left until invalid, to check validity keep trac

key in dict, value is the list of anagrams;


ck empty, return true;
, compare left and right, continue until left >= right, don’t distinguish between upper/lowercase;
d or even;
and outwards, do same for pali of even len; maybe read up on manachers alg

ber of levels in tree


ch level of both trees
que; iterative dfs is easy with stack if doing pre-order traversal
we also update maxSum by computing maxpathsum WITH a split;

added too, even if they're null, deserialize by adding each non-null node to queue, deque node, it's children a

eft subtree, right of root are right subtree, recursively build subtrees;
eters; iterative in-order traversal, check each val is greater than prev;
n the kth element processed, go left until null, pop, go right once;
ht subtree, then curr is lca;
DOESN’T have or need char, since root node doesn’t have a char, only children;
des children;
dictionary words, dfs on each cell, check if cell's char exists as child of root node in trie, if it does, update cu
n heap of size k for efficient pop/push; divide and conquer merging lists;
nd it should be left with k largest;
d all num less than med in a maxHeap, after every insertion update median depending on odd/even num of
/right on remaining list;

1, up until n, using for each coin (amount - coin), cache prev values
ust end with each num, curr num must be after a prev dp or by itself;
sted forloop to compute the cache without recursion;

ate solutions;

ded one way, 11, 26 decoded two ways

al node, if yes, then set it equal to goal node, continue;

visited, still visiting

nt the consecutive nums after num, ie num+1; there is also a union-find solution;
that are different, run topsort on graph and do loop detection;
e, before dfs on neighbor of N, remove N from neighbor list of neighbor;
um of meetings going at these points in time; for each meeting check if a prev meeting has finished before c

rk row/col that needs to be zeroed;

if windowlen=1 works, if yes, increment len, if not, shift window right;


d, to check validity keep track if the count of each unique char is satisfied;

upper/lowercase;

e, deque node, it's children are next two nodes in string;


e in trie, if it does, update currNode, and check neighbors, a word could exist multiple times in grid, so don’t

ending on odd/even num of elements;


meeting has finished before curr started, using min heap;
ultiple times in grid, so don’t add duplicates;

You might also like