
We model heights as bars and maximize the area between two lines, with width as index difference and height as the smaller height, yielding zero for empty or size-one arrays.
Apply the brute force approach to the two-wall container problem by trying every pair of walls, calculating area as the minimum height times width, and tracking the maximum area.
Walk through the brute force pseudo code using two nested loops to compute container area with two walls, updating the max area and noting the O(n^2) time and constant space.
Learn to optimize the brute force container problem using the two-pointer technique, moving the pointer at the smaller wall to maximize area and reduce time complexity from O(n^2).
Walk through a two-pointer pseudocode using left and right pointers to maximize container area. Compute area as min(heightL, heightR) times width, update max, and move the shorter wall.
Use a two-pointer approach to compute the maximum area by updating the max with min(height[left], height[right]) times (right-left), and moving the smaller height pointer.
The lecture explains how to determine a valid mountain array by checking for a strictly increasing prefix followed by a strictly decreasing suffix, with a length of at least three.
Demonstrate how to detect an increasing subsequence with a loop, break on a drop, and then track the end of a decreasing subsequence to ensure it reaches the array end.
Walks through pseudocode to verify a mountain array by scanning for an increasing subsequence, then a decreasing subsequence, and confirming end-of-array conditions, with O(n) time and O(1) space.
Implement the valid mountain array algorithm by simulating an ascent to a peak and a descent to the end, using an index-driven Swift approach.
Solve the boats to save people problem by pairing weights within a limit, with at most two per boat, to minimize total boats.
Sort the weights and use a two-pointer strategy to pair the heaviest with the lightest under the boat limit, maximizing two-person boats.
Walks through the pseudocode for the boats to save people problem using sorting and two pointers to pair lightest with heaviest within the limit, and explains time and space complexity.
Sort the array ascending, then use two pointers to pair lightest and heaviest within the weight limit. If they fit, move both; else, send the heaviest alone, and increment boats.
Walk through the brute force pseudocode to collect non-zero elements into an output array, then append zeros. Note time and space costs and possible in-place optimization for the next video.
Adopt an in-place, two-pointer approach to move non-zero elements to the front and fill the remainder with zeros, using a single j pointer guided by a scanning i.
Learn the optimal two-phase move zeros solution, using a j pointer to move nonzero elements forward and then fill the rest with zeros, achieving O(n+m) time and O(1) space.
Implement the in-place move zeros algorithm in Swift, preserving non-zero order while moving zeros to the array end, then submit to LeetCode with test cases.
Explore the longest substring without repeating characters, clarify substrings are contiguous, compare with subsequences, examine examples and edge cases, and preview a brute force solution approach.
Explore a brute force approach to the longest substring without repeating characters by checking all substrings, using a map to track seen characters, and resetting on duplicates.
Explore the pseudocode for finding the longest substring without repeating characters, from brute force to a sliding window solution using a seen characters map and left and right pointers.
Explore a sliding-window approach with left and right pointers and a character-index map to find the longest substring without repeating characters, achieving O(n) time and O(n) space.
Implement a function to return the length of the longest substring without repeating characters using a sliding window with left and right pointers and a hash map of character positions.
Explore brute force strategies to find the first and last positions of a target in a sorted array, returning indices or negative one when not found.
Walk through a brute force approach with pseudocode, implementing find first and find last on an input array. Analyze time and space complexity, showing O(n) time and O(1) space.
Apply binary search to a sorted array to locate the first and last positions of a target, using left and right pointers to narrow the search efficiently.
Learn to use a two pointer binary search to find the first and last occurrences of a target in a sorted array, guided by the pseudocode walkthrough part 1.
Walk through a pseudocode driven binary search using left and right pointers to locate the last occurrence of the target. The method runs in O(log n) time with O(1) space.
Use binary search on a sorted array to locate the first and last occurrences of a target, implementing findFirst and findLast to return the index range.
Examine the first bad version problem using a brute force linear search, calling isBadVersion from 1 to N and returning the first bad version, with O(N) time and O(1) space.
Use binary search on versions 1 to n with isBadVersion to locate the first bad version, halving the search range via mid and adjusting L and R.
Learn an optimal binary search approach to find the first bad version using the isBadVersion API, with two pointers and mid updates, achieving O(log n) time and O(1) space.
Master binary search to find the first bad version in a sequence of releases, using left and right pointers, mid checks, and isBadVersion to return the rogue version on LeetCode.
Identify the missing number in an array of n distinct numbers. The numbers come from zero to n, with n as the array length and exactly one missing number.
Explore the brute force approach to find the missing number in an array by sorting, comparing consecutive elements, and returning the gap number, with pseudocode for implementation.
Explain solving the missing number in zero to n and switch from a naive O(n^2) search to a hash map based O(n) solution using a presence map for constant-time checks.
Walk through this pseudo code by building a presence map from inputs, then loop 0 to n to find the missing number, with O(n) time and O(n) space.
Implement a function that finds the missing number by subtracting the current sum from the expected sum of 0 to n inclusive, then test the solution on LeetCode.
Use Gauss's formula n(n+1)/2 to compute the intended sum, find the missing number by subtracting the actual sum from the expected sum, achieving O(n) time and O(1) space.
Implement the missing number solution by summing present numbers and applying Gauss's formula n(n+1)/2 to find the missing value and submit to LeetCode.
Explore counting primes less than a non-negative n using a brute-force approach that tests divisibility from two up to the current number, yielding the count.
Walk through a brute force primality check using pseudocode, testing numbers from two up to the input, and note the time complexity O(n^2) and space O(1) with optimization coming next.
Learn a sieve-based approach to finding primes by eliminating multiples, starting from i squared and stopping at the square root of n, then count primes by tallying true entries.
Walk through the sieve of Eratosthenes for n = 34, marking multiples of each prime and counting true entries to reveal all primes under 34.
Count primes up to n with an isprime array. Initialize 0 and 1 as false, loop i from 2 to sqrt(n), mark multiples false, then sum true entries.
Want to master popular problem-solving techniques, data structures, and algorithms that interviewers love? Dive right in!
Crave step-by-step explanations for the industry's hottest interview questions? We've got you covered.
Looking to up your game in competitive programming? Buckle up for a thrilling journey!
Welcome to the course!
In this course, you'll have a detailed, step by step explanation of hand-picked LeetCode questions where you'll learn about the most popular techniques and problems used in the coding interview, This is the course I wish I had when I was doing my interviews. and it comes with a 30-day money-back guarantee
What is LeetCode?
LeetCode is essentially a huge repository of real interview questions asked by the most popular tech companies ( Google, Amazon, Facebook, Microsoft, and more ).
The problem with LeetCode is also its advantage, IT'S HUGE, so huge in fact that interviewers from the most popular companies often directly ask questions they find on LeetCode, So it's hard to navigate through the huge amount of problems to find those that really matter, this is what this course is for.
I spent countless hours on LeetCode and I'm telling you that you don't have to do the same and still be able to get a job at a major tech company.
Course overview :
In this course, I compiled the most important and the most popular interview questions asked by these major companies and I explain them, in a true STEP BY STEP fashion to help you understand exactly how to solve these types of questions.
The problems are handpicked to ensure complete coverage of the most popular techniques, data structures, and algorithms used in interviews so you can generalise the patterns you learn here on other problems.
Each problem gets multiple videos :
Explanation and intuition video(s): we do a detailed explanation of the problems and its solution, this video will be longer because we will do a step by step explanation for the problems.
Coding video(s): where we code the solution discussed in the explanation video together.
Walkthrough video(s): where we go over each line of code and see what it does
We will use basic Swift for this course to code our solutions, previous knowledge in Swift is preferred but NOT required for the coding part of the course.
The problems are categorised for easier navigation and will be regularly updated with more popular and interesting problems.
Some of the stuff this course will cover are :
Arrays and Strings interview questions.
Searching interview questions and algorithms.
Dynamic Programming interview questions.
Backtracking interview questions ( With step by step visualisation ).
Trees and Graphs interview questions and algorithms.
Data structures Like Stacks, Queues, Maps, Linked Lists, and more.
In other words, this course is your one-stop-shop for your dream job.