
Explore solving the container with the most water problem by selecting two heights from an array, computing area as min height times index difference.
Use a brute force approach by trying every pair of walls, calculating area as min(height i, height j) times (j - i), and updating the maximum area.
Explore a brute force pseudocode walkthrough of the container problem, computing max area using min height and index difference, with o(n^2) time and o(1) space.
Apply the two-pointer technique from the array ends, compute area as min(height_left, height_right) times width, and move the pointer at the smaller wall to maximize the container area.
Use a two-pointer approach with left and right indexes to compute area as the min height times distance, updating the max area while moving the shorter wall.
Implement a two-pointer algorithm to compute the maximum area by updating max area with min(height left, height right) times their width, and move the smaller height pointer.
Identify an increasing subsequence by looping and comparing each element to the previous. Save the end of the increasing run, then verify the ending decreasing subsequence reaches the array end.
Follow a pseudocode walkthrough to detect a valid mountain array by scanning for an increasing subsequence, then a decreasing subsequence, with O(n) time and O(1) space.
Implement and validate a function that detects a valid mountain array by climbing while values increase, then descending until the end, with checks for invalid starts or flat sections.
Master the boats to save people problem by pairing weights from the array under a limit, so each boat carries at most two people and minimizes the total boats needed.
master a greedy two-pointer approach to the boat pairing problem: sort weights, pair the heaviest with the lightest when their sum fits the limit, otherwise ship the heaviest alone.
Sort the weights, then use a two-pointer approach to pair the heaviest and lightest within the limit, counting boats. The time complexity is O(n log n) and space is O(n).
Sort the weights, then use two pointers to pair lightest and heaviest within the limit, computing the minimum number of boats. Practice with a PHP implementation and LeetCode tests.
Move all zeros to the end while preserving the order of non-zero elements by first collecting non-zeros in a new array and then appending zeros for the remaining positions.
Walk through a brute force pseudocode for moving non-zero elements to an output array, append zeros, and analyze time and space complexity with a hint at in-place optimization.
Develop an in-place approach to move non-zero elements to the front of an array using two pointers, tracking non-zeros with a j pointer while shifting elements and filling zeros.
Walks through the optimal two-pass move zeros algorithm in PHP: shifts non-zero elements forward using index j, then fills the remaining positions with zeros, achieving O(n+m) time and O(1) space.
Move zeros to the end of the array in place by using a zero index to place non-zero elements, then fill the rest with zeros, preserving order.
Explore the problem of finding the length of the longest substring without repeating characters in a string, noting that substrings are contiguous and distinct from subsequences.
Explore a brute force approach to finding the longest substring without repeating characters by checking all substrings, using a hash map to track seen characters, and updating the maximum length.
Walk through the pseudocode for brute force approach to the substring without repeating characters, detailing left and right pointers and a seen characters map, and hinting at sliding window optimization.
Apply the sliding window approach with two pointers and a last-seen map to find the longest substring without repeating characters. Use max to adjust the left boundary.
Walks through a sliding window approach to find the longest substring without repeating characters, using a seen characters map to update the left bound and track the maximum length.
Implement the longest palindrome using bottom-up dynamic programming with an is_palindrome matrix. Use end and start indices to build palindromes from smaller substrings.
Identify the first and last positions of a target in a sorted array by brute force, scanning left for the first occurrence and right for the last.
Walk through a brute force approach with pseudocode, implementing find first and find last in an array using forward and backward loops, and analyze big o time and space complexity.
Apply binary search on a sorted array to find first (leftmost) occurrence of the target, then locate the last occurrence by narrowing the search span with left and right pointers.
Walk through a pseudocode binary search using two pointers to find the first and last occurrences of a target in a sorted array, detailing left, right, and mid computations.
Explore a two-pointer and binary search approach to locate the last occurrence of a target in a sorted array, using left, right, and mid pointers with constant space.
Implement binary search to locate the first and last positions of a target in a sorted array, using find first and find last methods and returning them as an array.
Explore the first bad version problem with a brute force linear search using the is bad version method to locate the first bad version and discuss time and space complexity.
Use the optimal solution by leveraging isBadVersion to locate the first bad version, halving the search span via the middle and updating left and right pointers until L equals R.
Walk through a binary search to find the first bad version using a mock isBadVersion API, narrowing with left and right pointers for log n time and constant space.
Search for the earliest bad version using binary search, with left and right pointers and mid checks via isBadVersion to pinpoint the first rogue version efficiently.
Explain the missing number problem: find the missing value in an array of n distinct numbers from zero to n, with examples [2,3,1,0] and [1].
Sort the input to form a zero-to-length sequence, then scan for a gap. Return the current element minus one when a gap appears.
Walk through a pseudo code approach that builds a present numbers map from the input, checks 0 to n, and returns the missing number with O(n) time and O(n) space.
Implement a frequency map to count each input number, then identify the element whose frequency exceeds half the input size and return it as the majority element.
Use the optimal approach with Gauss's formula n(n+1)/2 to find the missing number in a 0..n sequence. Achieve O(n) time and O(1) space by comparing expected and actual sums.
Implement the missing number function by summing the input numbers and using Gauss's formula to compute the expected total, then subtract to reveal the missing value and submit to LeetCode.
Count primes in this course module by determining how many primes are less than a given n using a brute force method. Learn prime definition, divisibility checks, and edge cases.
Walk through a pseudocode brute-force prime check using nested loops, showing how 2 and 3 are primes and 4 is not, and analyze time complexity O(n^2) with O(1) space.
Apply the sieve truthiness algorithm to mark non-primes by eliminating multiples of each prime from two to sqrt(n), using an isprime array. Count remaining true values to determine primes.
Demonstrates the Sieve of Eratosthenes to identify primes up to 34 by marking multiples. Explains prime validation, square-root stopping, and a practical code walkthrough.
Implement count primes with a sieve up to n, initializing isprime, marking 0 and 1 as non-prime, using sqrt(n) optimization, and counting 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 PHP for this course to code our solutions, previous knowledge in PHP 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.