
This is an introduction of the course
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.
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.
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.
Explore determining a palindrome in a linked list using two pointers, fast and slow, to the midpoint, and reverse the second half for comparison.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 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 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.
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.
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.
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 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.
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.
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.
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.
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!