
This is an introduction of the course
Determine if a binary tree is symmetric by recursively comparing left and right subtrees as mirrors. Implement a helper with base cases for null nodes and value checks.
Learn how to invert a binary tree in a leetcode-style question, using a swap-based approach that inverts left and right subtrees and recurses to children.
Merge two binary trees recursively by summing overlapping nodes and merging left and right subtrees, handling base cases where one tree is null.
Explore the two sum brute force approach, using nested loops to find the pair that sums to the target and return their indices, noting its O(n^2) inefficiency.
Solve the two sum problem with a hashmap to achieve linear time by storing complements and returning the indices that add up to the target.
Sort the array of integers and check adjacent elements for duplicates, returning true when any value repeats and false when all elements are distinct.
Learn how to reverse a singly linked list by iterating, using a temporary node, and updating pointers to produce a reversed output.
solve two sum II with a sorted array using start and end pointers, returning one-based indices when the pair sums to the target.
Explore determining a palindrome in a linked list using two pointers, fast and slow, to the midpoint, and reverse the second half for comparison.
Explore solving the valid palindrome problem from LeetCode by filtering alphanumeric characters, converting to lowercase, and using a two-pointer approach to verify palindrome symmetry.
Generate the first numRows of Pascal's triangle by starting each row with 1s and computing inner values as sums of adjacent numbers from the previous row.
Learn n-ary tree postorder traversal using a recursive helper that visits each node's children, pushes the node's value to an output list, and handles a null root.
Perform an in-order traversal on a binary tree by visiting the left subtree, then the root, then the right, building a list of node values with a recursive helper function.
Explore a preorder traversal of an n-ary tree by visiting the root first, then all children recursively, using a helper function to build the output list.
Explore how to determine palindrome numbers in a LeetCode challenge, using both string-based and purely arithmetic approaches, handling negatives and zero-edge cases while reversing digits.
Reverse an integer by extracting digits with mod ten, skip leading zeros, build reversed number, and preserve the sign. Use a long variable to detect 32-bit overflow and return zero.
Determine the minimum number of parentheses to add to make a string valid, using counting and stack approaches to balance left and right parentheses.
Determine the maximum depth of a binary tree from its root using a simple recursive approach, with base cases for null nodes and a stepwise evaluation of child depths.
Explore whether a binary tree has a root-to-leaf path whose node values sum to a given target, using recursion that subtracts the current node value and checks leaves.
learn to perform binary search on a sorted array to find a target by halving the range, using a safe mid, and returning the index or -1 when not found.
Tackle the 100 LeetCode challenge by solving the hardest question: input a string and output its lowercase form in 30 seconds, with code review and a quick submission.
Rearrange a linked list by grouping nodes at odd positions first, then at even positions. Use pointer manipulation to connect nodes in the correct order.
Learn to solve the first bad version problem with binary search across versions 1 to n. Understand how midpoints guide the search to reveal the earliest bad version.
Use two stacks to simulate backspaces on strings s and t. Then compare the final stacks to determine equality.
Count the number of islands in a 2d grid of ones and zeros using a dfs helper that flips visited land to zero and explores up, left, right, and down.
Learn to detect a linked list cycle using slow and fast pointers, returning a boolean when the pointers meet while safely handling null checks.
Explain and solve a nested list weight sum problem by iterating through each depth level, accumulating integers multiplied by their depth, using a temporary list to manage the next level.
Learn to reverse a string in place by swapping characters in an array using two pointers, start and end, with O(1) memory and no return value.
Learn to find the middle node of a non-empty singly linked list using fast and slow pointers, returning the second middle node when two exist.
Merge two sorted linked lists by iterating with pointers, compare values, and append the smaller node to a merged list built with a temporary head, then attach leftovers and return.
Determine whether a robot returns to origin for leetcode 657 by processing a moves string (u, d, l, r) and tracking horizontal and vertical deltas until both reach zero.
Learn to solve the keys and rooms problem (LeetCode 841) with a hash set and a stack, starting from room zero, to determine if all rooms can be visited.
Square each element in a sorted array, then sort the squared results to obtain a non-decreasing sequence, illustrating a practical solution for coding interviews.
Apply a two-pointer approach to the container with most water problem, using left and right pointers and maximum heights to maximize trapped water between line pairs.
Sort the nums array, then use a start and end pointer for each i to find the three-number sum closest to target, updating the closest sum by absolute distance.
Use breadth-first search over a binary tree to find the largest value in each row, maintaining a level-based output and updating the maximum per level.
Explore binary tree pruning by removing subtrees that contain no ones, using depth-first search and recursion to keep only branches with value one.
Solve the hand of straights by using a priority queue to form groups of W consecutive numbers from a sorted array and ensure all cards fit.
Determine if the array can be divided into sets of size w with consecutive numbers by repeatedly removing the smallest value and forming a consecutive group using a priority queue.
Swap every two adjacent nodes in a linked list and return the head. Use a dummy node or swap node values with a temporary variable while traversing until the end.
Learn a level-order traversal using a queue to process levels from right to left, updating the current node. The final updated node gives the bottom-left value of the last row.
Partition list using two separate lists for nodes smaller than x and those greater or equal, preserving relative order, then concatenate the partitions to form the final list.
Learn to compute binary tree right side view by collecting the rightmost node from each row. Return them in an output array by processing row from right to left.
Flatten a binary tree to a rightward linked list in place using a stack. Process nodes in root-left-right order by pushing right then left, linking nodes and nulling left pointers.
Sort a linked list by inserting each node into a priority queue, then pop nodes in ascending order to build the sorted list.
Explore searching for a target value in a binary search tree and returning the matching subtree root, or null if not found, using recursive left or right traversal.
Discover how to locate the peak index in a mountain array, using a linear scan and a faster binary search with two pointers, achieving O(log n) time.
Calculate the sum of left leaves in a binary tree by adding a left child’s value when it has no children and recursively traversing the left and right subtrees.
Learn to reverse only letters in a string while keeping non-letter characters in place using a two-pointer approach that swaps letters and returns the modified string.
Learn to compute the range sum of a binary search tree using recursion, summing node values within a given low and high inclusive range.
Explore solving Leetcode 965 unit value binary tree by building a recursive helper that compares every node to the root value.
Learn to distribute coins in a binary tree by moving coins between parent and child nodes so every node ends with exactly one coin, using a recursive helper approach.
Explore how to determine the completeness of a binary tree using a queue and a last-node flag to enforce left-to-right filling in level order.
Count provinces by depth-first search on an adjacency matrix, using a helper function and a visited array to explore and mark connected cities.
Apply topological concepts to the course schedule problem by computing indegree, building an adjacency map of prerequisites, and using a queue to determine if all courses can be completed.
Learn to count unique email addresses by normalizing local names: ignore dots, drop after plus, and compare domains, using a set to compute the final tally.
Learn how to translate each word into Morse code using a 26-letter mapping, then count unique translations with a set to solve the unique Morse code words problem.
practice sorting an array by parity by moving even elements to the front and odd elements to the back; use an output array and an index pointer.
Explore the leetcode 136 single number problem. See how a hash map counts frequencies and a bitwise xor solution achieves linear runtime with less memory and reveals the single number.
Learn to validate a 9x9 sudoku by checking digits 1–9 in rows, columns, and 3x3 subgrids for duplicates using a hash set approach.
Identify self-dividing numbers by verifying each digit divides the number, then list all values between the given lower and upper bounds using an efficient digit-check method.
Sort the array, then pair adjacent elements to maximize the sum of the smaller numbers in each pair, accumulating the minimums to yield the final result.
Add two numbers represented by non-empty linked lists of non-negative integers in reverse order, handle carries, and return the sum as a new linked list.
Learn how to determine whether a non-empty string can become a palindrome by deleting at most one character, using a two-pointer approach and substring checks with examples like aba.
Convert a binary search tree to a sorted doubly linked list by in-order traversal, using a dummy head and a previous pointer to link nodes in increasing order.
Solve the LeetCode parity II problem using a two-pointer in-place approach, placing even numbers at even indices and odd numbers at odd indices by swapping mismatches.
Master the best time to buy and sell stock with a single transaction by tracking the minimum price in the prices array. Return zero if no profit is possible.
transpose a matrix by swapping rows and columns to produce an output array with swapped dimensions. use nested loops to copy each a[i][j] into output[j][i] and return the transposed result.
Learn to rotate a 2d matrix by 90 degrees clockwise in place by flipping each row left-right and then swapping across the anti-diagonal.
Explore spiral matrix traversal in spiral order using four pointers to traverse from the outer layer to the center, collecting elements in a single pass.
Learn how to reconstruct an itinerary from a list of airline tickets, starting at JFK, and choose the lexicographically smallest valid route using a map, priority queue, and stack technique.
Learn to generate an n by n spiral matrix filled with 1 to n squared in spiral order, using four directions and dynamic row and column pointers.
Apply a sliding window to find the minimum length subarray with sum at least s, using a start pointer and dynamic sum updates, illustrated by the example s = 7.
Identify universal words by comparing letter frequencies: build a 26-letter frequency array for B, take per-letter maxima, and test A to output universals.
Learn to search a 2d matrix efficiently by treating it as a flattened 1d array and applying binary search to locate the target, including edge cases.
In this lecture, you implement fizz buzz by looping from 1 to n, outputting fizz, buzz, or fizzbuzz when divisible by 3, 5, or both, otherwise number as a string.
Determine if string b can be obtained by rotating string a. Double a to a+a and check if it contains b; ensure equal lengths, otherwise return false.
Remove all adjacent duplicates in a string using a stack and a string builder; push nonmatching chars, pop on duplicates, then reverse the builder to return the final string.
Learn to find the max consecutive ones in a binary array using a two-pointer approach, updating the maximum length as you traverse and reset when you hit zero.
Group the input characters into blocks of size k, ignoring dashes, and convert to uppercase. Build the result by inserting dashes while traversing backward, then reverse for correct order.
Remove vowels from a string using a string builder, looping through characters and skipping vowels while appending others. Return the built string.
Learn to reorder a singly linked list by alternating the head and tail nodes using three pointers, linking last after first and recursing on the remaining sublist.
Learn to remove the nth node from the end of a linked list using a dummy node and slow and fast pointers, including an example and returning the updated head.
Implement tic tac toe on a 3x3 matrix using 1 and -1 to track moves, updating rows, columns, diagonals, and anti-diagonal; return 1 for a win or 0 otherwise.
Explore solving next greater element I by mapping each nums1 element to the first greater element on the right in nums2, or -1 if none exists, using a hash map.
Learn to solve the next greater element II for a circular array using a stack and the extend-and-mod trick to compute each element's next greater neighbor.
Convert the linked list to an array, then use a stack to locate the next greater element for each node, producing an output array with zeros where none exists.
Learn to rotate an array to the right by k using k mod length, by rotating whole array and reversing parts with a helper that swaps start and end indices.
Sorts an array of zeros, ones, and twos in constant space using a three-pointer approach: move twos to the end, zeros to the start, with ones in the middle.
Explore the fibonacci number sequence and implement an iterative solution using two variables, handling base cases and updating first and second, with notes on recursion and arrays, stacks, and queues.
Master the min cost climbing stairs problem from leetcode 746, learning how to compute the minimum total cost to reach the top with 1 or 2 steps using dynamic programming.
Explore finding the pivot index where left sum equals right sum, using total sum and accumulate sum, returning -1 if none.
Learn to flip a matrix of 0s and 1s by first flipping each row left-to-right and then inverting bits, using a two-pointer approach to handle same and different pairs efficiently.
Explore solving max consecutive ones iii with a sliding window. Track left and right pointers, spend k on zeros, and shrink when k goes negative to find the longest ones.
Remove all nodes with a target value from a linked list using a dummy head to simplify deletions; skip matching nodes and return the list at dummy.next.
Validate a string of parentheses and brackets with a stack by pushing left symbols and popping when right symbols match; true if all pairs match and the stack is empty.
Determine if two strings s and t are anagrams using a 26-letter frequency table, incrementing for s and decrementing for t, with a final zero-check and an edge-case length check.
This course is for all those people who want to learn the basics of data structure and algorithms from the absolute beginner to the Intermediate level. We will use many examples to make the lectures very easy to understand and digest.
You don't really need to have prior knowledge of Data Structure or Algorithm, but a basic prior knowledge of any programming language will be helpful!
After going through these 100 Leetcode questions, you will get your foot wet and start trying some "Medium" questions soon. The purpose of this course is to learn fast and give you the confidence to start working on Leetcode questions.
Most of these LC questions are EASY level or MEDIUM level with a quick solution. You can get the most out of it by following along. Because Medium question is like few Easy questions combined together. A Hard question is a combination of a few Medium questions. In the future, I will try to make a Medium level of Leetcode for all of you!
If you have any questions, please feel free to comment it below. I will get back to you as soon as possible.
If you have any suggestions on me improving the videos and contents, please also let me know, so that I can make better videos in the future. I hope you have a wonderful learning experience here!