
Explore the container with the most water: given an array of heights, identify two lines that maximize trapped water, with area equal to the minimum height times the index distance.
Apply the brute force approach by looping every pair of walls, compute the area as the minimum between their heights times the distance between them, and track the maximum area.
Explore a brute force pseudocode walkthrough for computing the maximal area by pairing walls, using min height as length and width as index difference, with O(n^2) time and constant space.
Learn how the two-pointer technique replaces brute-force in the container problem, improving time complexity, by moving the pointer at the smaller height to maximize area.
Walk through a two-pointer pseudocode for the container problem, computing area using the minimum height and width, updating the max area, and moving the shorter wall pointers.
Implement the two-pointer solution for the container with most water by initializing max area and L, R pointers, updating area with min(height[L], height[R])*(R-L), and moving the smaller height pointer.
Evaluate whether an array forms a valid mountain array by verifying a strictly increasing sequence from the start followed by a strictly decreasing sequence, with length at least three.
Check for an increasing subsequence by looping from the second element and comparing current to previous; break on failure, track its end, ensure a decreasing subsequence reaches the array end.
Walk through a pseudocode-based check for a mountain array by tracing an increasing subsequence then a decreasing subsequence, using a pointer index. Analyze O(N) time and O(1) space.
Implement the valid mountain array logic by traversing uphill to a peak, then descending, returning true only if the whole array is consumed, and validate with LeetCode test cases.
Analyze the boats to save people problem by pairing at most two people per boat so their weights stay within the limit, yielding the minimum number of boats.
Sort the weights, then use two pointers to pair heaviest with lightest within the limit, counting boats; if they can't pair, send the heaviest alone.
Walk through a two-pointer solution to assign boats for weights under a limit, using sorting and a heaviest/lightest pointer strategy; conclude with time complexity O(n log n) and O(n) space.
Sort the weights in ascending order, then use two pointers from the lightest and heaviest to pair passengers within the limit, counting boats until all are carried.
Move zeros to the end of the array while preserving the relative order of non-zero elements. Use a brute-force approach: scan and collect non-zeros, then append zeros.
Analyze a brute force pseudocode walkthrough for removing zeros by collecting non-zero elements into an output array, then appending zeros, and discuss time and space complexity.
Optimize a brute-force solution with an in-place two-pointer approach that moves non-zero elements to the front in their original order, using a j counter and no extra memory.
Walks through the optimal move zeros solution, detailing moving nonzeros forward with index j, then filling trailing positions with zeros, and analyzes O(n+m) time and O(1) space.
Move zeros to the end of the array in place, preserving the relative order of non-zero elements, by scanning with a zero index and a non-zero index, then filling zeros.
Explore the longest substring without repeating characters problem in Kotlin for coding interviews, detailing contiguous substrings, test cases, and a simple brute force approach.
Explore the brute force approach to find the longest substring without repeating characters by checking substrings, using hash maps to track seen characters, and restarting when duplicates appear.
Walk through the pseudocode for finding the longest substring without repeating characters using a brute force two-pointer approach, then introduce sliding window optimization and a seen-characters map.
Apply the sliding window approach with two pointers to find the longest substring without repeats, using a map of last seen indices and adjusting the left edge accordingly.
A pseudocode walkthrough shows a window with left and right boundaries and a seen characters map to compute the longest substring without repeats, with O(n) time and O(n) space.
Implement a sliding window algorithm using a map of each character's latest position to adjust left boundary and expand with the right pointer to obtain the longest unique substring length.
Find the first and last positions of a target in a sorted array using brute force searches from start and end, returning -1 -1 when the target is not found.
Walks through a brute force approach using pseudocode to find first and last indices of a target, and analyzes time and space complexity.
Leverage binary search on a sorted array to find the first and last positions of a target, using left and right pointers and mid checks to confirm first occurrence.
Explore a two-pointer and binary search approach to find the first and last occurrences of a target in a sorted array, using left, right, and mid pointers.
Follow a pseudocode walkthrough using two pointers to find the last occurrence of a target with binary search. Note the time is O(log n) and space is O(1).
Implement binary search to locate the first and last occurrences of a target in a sorted array using findFirst and findLast, and return them as an array.
Identify the first bad version by brute force linear search using the isBadVersion method, scanning from 1 to n and noting time complexity O(N) and space complexity O(1).
Apply the optimal binary search to locate the first bad version by halving the search range with the is bad version method, updating left and right until the range converges.
Demonstrates binary search to find the first bad version via a mock isBadVersion function, updating left and right with mid until left equals right, time O(log n), space O(1).
Learn to implement the first bad version detector using binary search, with left and right pointers and mid checks, using isBadVersion to pinpoint the earliest bad version.
Tackle the missing number problem: find the number missing from an array of n distinct numbers from zero to n.
Use the brute force approach by sorting the input and scanning for a gap bigger than one, returning the missing number as current minus one.
Use Gauss's formula to compute the expected sum from 0 to n, subtract the actual sum to reveal the missing number, achieving O(n) time and O(1) space.
Implement the missing number solution by summing inputs and subtracting from Gauss's total n(n+1)/2, then verify on LeetCode.
Count primes less than n by brute force: assume i is prime, test divisibility from 2 to i, and increment if no divisor exists; for input 10, answer is 4.
Walk through a pseudocode brute force approach to finding primes, using an is prime flag and nested loops, and analyze time complexity of O(n^2) and space O(1).
Explore a sieve-based approach to finding primes, marking multiples of each prime from i*i in an isprime array up to n, and count the remaining primes.
Walks through the sieve of Eratosthenes pseudocode to identify primes up to 34 by marking multiples in a boolean array and stopping at sqrt(n).
Implement a prime-counting function up to n using an isprime array, marking 0 and 1 non-prime and checking up to sqrt(n), then count primes for LeetCode tests.
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 Kotlin for this course to code our solutions, previous knowledge in Kotlin 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.