
Solve the container with the most water problem by choosing two lines from a height array, computing area as width times the minimum height.
Enumerate all wall pairs to compute each container's water area as the minimum height times the width, and track the maximum.
Follow a brute force pseudocode walkthrough of the container with most water, evaluating all wall pairs to maximize the area while noting O(n^2) time and constant space.
Apply a two-pointer strategy to the two walls problem, use min height times width to compute area, and move the pointer at the smaller wall to improve from n^2 time.
Walk through the pseudocode to implement a two-pointer solution that uses the min height of the left and right pointers to compute the max container area.
Implement the two-pointer solution for the container with most water problem, initializing max area, moving left and right pointers based on heights, and computing area as min(height[left], height[right]) times width.
Identify a valid mountain array by verifying a strictly increasing prefix followed by a strictly decreasing suffix in an array of integers of length at least three.
Learn to detect an increasing subsequence by looping and breaking on a drop, then track its end and verify a trailing decreasing subsequence finishes at the array end.
Follow a pseudocode walkthrough of validating a mountain array by stepping through indices, checking increasing then decreasing subsequences, and analyzing time and space complexity as O(n) and O(1).
Implement the valid mountain array function in Java by climbing uphill through the array, then descending, returning true when the end is reached and false otherwise.
Explore the boats to save people problem, where an array of weights and a limit define two-person boats to minimize the total number of boats.
Sort the people by weight, then use two pointers: the lightest and the heaviest, to pair two people per boat within the limit. If not, send the heaviest alone.
Walks through a pseudocode solution for the boat problem, sorting weights, and using heavy and light pointers to pair passengers under a limit, resulting in three boats for [3,2,1,3].
Sort the array in ascending order, then use two pointers from the lightest and heaviest ends to pair people within the limit, counting boats until all are placed.
Explore the brute force approach to the move zeros problem, moving non-zero elements to the front while preserving their order and filling the remainder with zeros.
Walk through the brute force pseudocode for extracting non-zero elements into an output array, append zeros, analyze time complexity and space complexity, and preview in-place optimization.
Learn to optimize a brute-force solution by using two pointers to move non-zero elements to the front in place, track the count of non-zeros, and fill the remainder with zeros.
Learn the optimal move zeros solution: set j to zero, move non-zero elements forward, then fill the rest with zeros; time is n plus m and space is constant.
Implement the move zeros algorithm in place, moving nonzero elements forward while preserving their order and filling the end with zeros, using a zero index and a nonzero index.
Explore the longest substring without repeating characters problem, learn that substrings are contiguous, distinguish them from subsequences, and review concrete test cases and a brute force approach.
Explore brute force intuition for finding the longest substring without repeating characters by checking all substrings and tracking duplicates with a hash map.
Explore a pseudocode walkthrough of finding the longest substring without repeating characters, starting from brute force to a sliding window solution using a seen characters map.
Explore the sliding window approach to the longest substring without repeating characters by using two pointers and a last seen map to update the window and maximize length.
Walks through a pseudocode sliding-window approach to find the longest substring without repeating characters, using left and right pointers and a seen-characters map, with O(n) time and O(n) space.
Implement a sliding window solution with a hash map to return the length of the longest unique substring in a string, updating left and right pointers and the latest positions.
Learn the brute force approach to find the first and last positions of a target in a sorted ascending array, returning the index pair or -1 -1 when not found.
Walk through a brute force approach with pseudocode, show how to find the first and last indices of a target in an array, and discuss time complexity and space complexity.
Apply binary search on a sorted array to locate the first and last positions of a target, achieving an optimal solution by halving the search span.
Demonstrate a binary search using two pointers and mid to locate the first and last occurrences of a target in a sorted array.
Walk through the pseudocode for finding the last occurrence of a target using two pointers and mid checks. Learn the binary search approach with O(log n) time and O(1) space.
Develop functions to find first and last positions of a target in a sorted array using binary search, returning the two positions as an array or -1 if not present.
Identify the first bad version with a brute-force linear search using isBadVersion, testing from 1 to n. It runs in O(n) time and O(1) space.
Master the optimal solution for finding the first bad version by applying binary search. Use isBadVersion, halve the search range, and return the first bad version efficiently.
Apply a binary search using two pointers to locate the first bad version with a given isBadVersion API, halving the search range and achieving O(log n) time and O(1) space.
Apply binary search to find the first bad version by checking the midpoint with isBadVersion and adjusting left and right pointers; return the first version that is bad.
Identify the missing number in an array of distinct integers taken from zero to n. Explore constraints, confirm a single missing value, and review practical test cases with examples.
Learn a brute force approach to find a missing number by sorting the input and detecting a gap between consecutive elements, then returning current minus one.
Explore two approaches to find the missing number from 0 to n: a nested loop with O(n^2) time, and an optimized O(n) solution using a hash map for constant-time lookups.
Walk through a map-based approach: mark inputs in a present-numbers map, then scan 0 to n to find and return the missing value; time and space are O(n).
Apply Gauss's formula to compute the missing number by comparing the expected sum from zero to n with the actual sum, achieving O(n) time and O(1) space.
Implement the missing number function by tallying the input numbers, computing the total with Gauss's formula n(n+1)/2, and returning the difference as the missing number.
Count primes less than a non-negative n using a brute force primality check that tests divisibility from 2 to the current number, with edge cases like n = 1 or 2.
Walk through a pseudocode brute-force prime check from two to n, using an is prime flag and a divisibility loop, then analyze time complexity O(n^2) and space O(1).
Apply the sieve truthiness algorithm to mark non primes by eliminating multiples of each prime from two up to sqrt(n), then count the true entries to get primes.
Implement the sieve of Eratosthenes to identify primes up to 34 by marking multiples of each prime starting from two, up to the square root of n.
Implement a count primes function in Java by initializing an isprime array, handling N<2, marking multiples up to sqrt(N), and counting true values to return the prime count.
Explore the single number problem in an unsorted array where every value appears twice except one, with a brute-force mindset. Apply hash maps to count occurrences and return the single.
Build a map of element occurrences by looping through inputs, then check keys to return the element with a single occurrence, and note the time and space complexity is O(n).
Apply a better approach to the single number problem by using a set to compute twice the sum of unique elements minus the actual sum, revealing the sole element.
Implement the single number solution in Java by building a map to count occurrences, then perform a second pass to return the number that appears once.
Explore an optimal approach that uses bitwise xor to cancel duplicates, achieving linear time with constant space while revisiting binary representations and bit manipulation.
Implement the optimal approach by iterating the input, initializing a zero result, and applying bitwise XOR to isolate the single number using XOR properties.
Getting ready for your software engineering coding interview? This is the place for you.
Want to learn about the most popular problem-solving techniques, patterns, data structures, and algorithms used in those difficult interviews? Come on in
Want a step by step explanation of the most popular interview questions in the industry? You got it.
Want to get better at competitive programming? Enjoy the ride
Welcome to the course!
In this course, you'll have a detailed, step by step explanation 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 generalize 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 Java for this course to code our solutions, previous knowledge in Java 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 call stack 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.