- 80
- 622 571
Terrible Whiteboard
United States
Registrace 23. 09. 2019
Hi, everyone! I'm a professional software engineer. This channel is for all programmers looking for ways to improve their skills and find their next job, whether it be via tutorials on data structures and algorithms or resources like LeetCode specifically.
LeetCode
Tutorials
Coding Interview Prep
Algorithms
Data Structures
LeetCode
Tutorials
Coding Interview Prep
Algorithms
Data Structures
Add Two Numbers | LeetCode 2 | Coding Interview Tutorial
Add Two Numbers solution: LeetCode 2
Code and written explanation: terriblewhiteboard.com/add-two-numbers-leetcode-2/
Link to problem: leetcode.com/problems/add-two-numbers/
Buy Me a Coffee: www.buymeacoffee.com/terriblewboard
AFFILIATE LINKS
If you're interested in learning algorithms, these are great resources.
💻 40% off Tech Interview Pro: techinterviewpro.com/terriblewhiteboard
⌨️ 20% off CoderPro: coderpro.com/terriblewhiteboard
💲 All coupons and discounts 💲
terriblewhiteboard.com/coupons-discounts/
Add Two Numbers | LeetCode 2 | Coding Interview Tutorial
#addtwonumbers #leetcode #algorithms #terriblewhiteboard #codinginterview
Click the time stamp to jump to different parts of the video.
00:00 Title
00:06 Problem readout
00:46 Whiteboard overview
02:31 Modulo operator explained
04:23 Back to whiteboarding
08:17 Whiteboard solution - sped up
10:09 Whiteboard solution - detailed
14:10 Coding solution
20:39 Result and outro
Code and written explanation: terriblewhiteboard.com/add-two-numbers-leetcode-2/
Link to problem: leetcode.com/problems/add-two-numbers/
Buy Me a Coffee: www.buymeacoffee.com/terriblewboard
AFFILIATE LINKS
If you're interested in learning algorithms, these are great resources.
💻 40% off Tech Interview Pro: techinterviewpro.com/terriblewhiteboard
⌨️ 20% off CoderPro: coderpro.com/terriblewhiteboard
💲 All coupons and discounts 💲
terriblewhiteboard.com/coupons-discounts/
Add Two Numbers | LeetCode 2 | Coding Interview Tutorial
#addtwonumbers #leetcode #algorithms #terriblewhiteboard #codinginterview
Click the time stamp to jump to different parts of the video.
00:00 Title
00:06 Problem readout
00:46 Whiteboard overview
02:31 Modulo operator explained
04:23 Back to whiteboarding
08:17 Whiteboard solution - sped up
10:09 Whiteboard solution - detailed
14:10 Coding solution
20:39 Result and outro
zhlédnutí: 19 542
Video
Odd Even Linked List | LeetCode 328 | Coding Interview Tutorial
zhlédnutí 4,9KPřed 4 lety
Odd Even Linked List solution: LeetCode 328 Code and written explanation: terriblewhiteboard.com/odd-even-linked-list-leetcode/ Link to problem: leetcode.com/problems/odd-even-linked-list/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great resources. 💻 40% off Tech Interview Pro: techinterviewpro.com/terriblewhiteboa...
Find the Town Judge | LeetCode 997 | Coding Interview Tutorial
zhlédnutí 5KPřed 4 lety
Find the Town Judge solution: LeetCode 997 Code and written explanation: terriblewhiteboard.com/find-the-town-judge-leetcode-997/ Link to problem: leetcode.com/problems/find-the-town-judge/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great resources. 💻 40% off Tech Interview Pro: techinterviewpro.com/terriblewhitebo...
Partition Equal Subset Sum | LeetCode 416 | Facebook Coding Interview Tutorial
zhlédnutí 9KPřed 4 lety
Partition Equal Subset Sum solution: LeetCode 416 Code and written explanation: terriblewhiteboard.com/partition-equal-subset-sum-leetcode-416/ Link to problem: leetcode.com/problems/partition-equal-subset-sum/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great resources. 💻 40% off Tech Interview Pro: techinterviewpr...
Jump Game | LeetCode 55 | Coding Interview Tutorial
zhlédnutí 7KPřed 4 lety
Jump Game solution: LeetCode 55 Code and written explanation: terriblewhiteboard.com/jump-game-leetcode-55/ Link to problem: leetcode.com/problems/jump-game/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great resources. 💻 40% off Tech Interview Pro: techinterviewpro.com/terriblewhiteboard ⌨️ 20% off CoderPro: coderpr...
Longest Consecutive Sequence | LeetCode 128 | Coding Interview Tutorial
zhlédnutí 4,7KPřed 4 lety
Longest Consecutive Sequence solution: LeetCode 128 Code and written explanation: terriblewhiteboard.com/longest-consecutive-sequence-leetcode-128/ Link to problem: leetcode.com/problems/longest-consecutive-sequence/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great resources. 💻 40% off Tech Interview Pro: techinter...
Longest Substring Without Repeating Characters | LeetCode 3 | Coding Interview Tutorial
zhlédnutí 22KPřed 4 lety
Longest Substring Without Repeating Characters solution: LeetCode 3 Code and written explanation: terriblewhiteboard.com/longest-substring-without-repeating-characters/ Link to problem: leetcode.com/problems/longest-substring-without-repeating-characters/submissions/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great...
Trapping Rain Water | LeetCode 42 | Coding Interview Tutorial
zhlédnutí 19KPřed 4 lety
Trapping Rain Water solution: LeetCode 42 Code and written explanation: terriblewhiteboard.com/trapping-rain-water-leetcode-42/ Link to problem: leetcode.com/problems/trapping-rain-water/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great resources. 💻 40% off Tech Interview Pro: techinterviewpro.com/terriblewhiteboar...
Is Subsequence | LeetCode 392 | Google Coding Interview Tutorial
zhlédnutí 3,5KPřed 4 lety
Is Subsequence solution: LeetCode 392 Code and written explanation: terriblewhiteboard.com/is-subsequence-leetcode-392/ Link to problem on LeetCode: leetcode.com/problems/is-subsequence/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great resources. 💻 40% off Tech Interview Pro: techinterviewpro.com/terriblewhiteboard...
Range Sum Query | LeetCode 303 | Coding Interview Tutorial
zhlédnutí 4,5KPřed 4 lety
Range Sum Query solution: LeetCode 303 Code and written explanation: terriblewhiteboard.com/range-sum-query-leetcode-303/ Link to problem: leetcode.com/problems/range-sum-query-immutable/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great resources. 💻 40% off Tech Interview Pro: techinterviewpro.com/terriblewhiteboar...
Remove Linked List Elements | LeetCode 203 | Coding Interview Tutorial
zhlédnutí 5KPřed 4 lety
Remove Linked List Elements solution: LeetCode 203 Code and written explanation: terriblewhiteboard.com/remove-linked-list-elements-leetcode-203/ Link to problem: leetcode.com/problems/remove-linked-list-elements/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great resources. 💻 40% off Tech Interview Pro: techintervie...
Intersection of Two Arrays | LeetCode 349 | Lyft Coding Interview Tutorial
zhlédnutí 7KPřed 4 lety
Intersection of Two Arrays solution: LeetCode 349 Code and written explanation: terriblewhiteboard.com/intersection-of-two-arrays-leetcode-349/ Link to problem: leetcode.com/problems/intersection-of-two-arrays/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great resources. 💻 40% off Tech Interview Pro: techinterviewpr...
Missing Number | LeetCode 268 | Amazon Coding Interview Tutorial
zhlédnutí 4,9KPřed 4 lety
Missing Number solution: LeetCode 268 Code and written explanation: terriblewhiteboard.com/missing-number-leetcode-268/ Link to problem: leetcode.com/problems/missing-number/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great resources. 💻 40% off Tech Interview Pro: techinterviewpro.com/terriblewhiteboard ⌨️ 20% off ...
Number of Islands | LeetCode 200 | Google Coding Interview Tutorial
zhlédnutí 10KPřed 4 lety
Number of Islands solution: LeetCode 200 Code and written explanation: terriblewhiteboard.com/number-of-islands-leetcode-200/ Link to problem: leetcode.com/problems/number-of-islands/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great resources. 💻 40% off Tech Interview Pro: techinterviewpro.com/terriblewhiteboard ⌨️...
Find All Numbers Disappeared in an Array | LeetCode 448 | Google Coding Interview Tutorial
zhlédnutí 11KPřed 4 lety
Find All Numbers Disappeared in an Array solution: LeetCode 448 Code and written explanation: terriblewhiteboard.com/find-all-numbers-disappeared-in-an-array-leetcode-448/ Link to problem on LeetCode: leetcode.com/problems/find-all-numbers-disappeared-in-an-array/ Buy Me a Coffee: www.buymeacoffee.com/terriblewboard AFFILIATE LINKS If you're interested in learning algorithms, these are great re...
Balanced Binary Tree | LeetCode 110 | Coding Interview Tutorial
zhlédnutí 8KPřed 4 lety
Balanced Binary Tree | LeetCode 110 | Coding Interview Tutorial
Binary Tree Level Order Traversal | LeetCode 102 | Google Coding Interview Tutorial
zhlédnutí 4,4KPřed 4 lety
Binary Tree Level Order Traversal | LeetCode 102 | Google Coding Interview Tutorial
Factorial Trailing Zeroes | LeetCode 172 | Coding Interview Tutorial
zhlédnutí 10KPřed 4 lety
Factorial Trailing Zeroes | LeetCode 172 | Coding Interview Tutorial
Linked List Cycle | LeetCode 141 | Coding Interview Tutorial
zhlédnutí 8KPřed 4 lety
Linked List Cycle | LeetCode 141 | Coding Interview Tutorial
Most Common Word | LeetCode 819 | Amazon Coding Interview Tutorial
zhlédnutí 3,7KPřed 4 lety
Most Common Word | LeetCode 819 | Amazon Coding Interview Tutorial
House Robber | LeetCode 198 | Google Coding Interview Tutorial
zhlédnutí 10KPřed 4 lety
House Robber | LeetCode 198 | Google Coding Interview Tutorial
Valid Perfect Square | LeetCode 367 | Coding Interview Tutorial
zhlédnutí 3,1KPřed 4 lety
Valid Perfect Square | LeetCode 367 | Coding Interview Tutorial
Binary Tree Level Order Traversal II | LeetCode 107 | Coding Interview Tutorial
zhlédnutí 5KPřed 4 lety
Binary Tree Level Order Traversal II | LeetCode 107 | Coding Interview Tutorial
Minimum Depth of Binary Tree | LeetCode 111 | Coding Interview Tutorial
zhlédnutí 7KPřed 4 lety
Minimum Depth of Binary Tree | LeetCode 111 | Coding Interview Tutorial
Maximum Depth of Binary Tree | LeetCode 104 | Google Coding Interview Tutorial
zhlédnutí 5KPřed 4 lety
Maximum Depth of Binary Tree | LeetCode 104 | Google Coding Interview Tutorial
Symmetric Tree | LeetCode 101 Amazon Coding Interview Tutorial
zhlédnutí 7KPřed 4 lety
Symmetric Tree | LeetCode 101 Amazon Coding Interview Tutorial
Path Sum | LeetCode 112 | Amazon Coding Interview Tutorial
zhlédnutí 5KPřed 4 lety
Path Sum | LeetCode 112 | Amazon Coding Interview Tutorial
Same Tree | LeetCode 100 | Google Coding Interview Tutorial
zhlédnutí 3,2KPřed 4 lety
Same Tree | LeetCode 100 | Google Coding Interview Tutorial
Find the Difference | LeetCode 389 | Google Coding Interview Tutorial
zhlédnutí 1,7KPřed 4 lety
Find the Difference | LeetCode 389 | Google Coding Interview Tutorial
Palindrome Linked List | LeetCode 234 | Coding Interview Tutorial
zhlédnutí 11KPřed 4 lety
Palindrome Linked List | LeetCode 234 | Coding Interview Tutorial
Best of the best explanation. I think understanding the problem here is the biggest challenge than actually solving it. Row 1: "1" (Base case) Row 2: "11" (Previous has one 1s) Row 3: "21" (Previous has two 1s) Row 4: "1211" (Previous has one 2s and one 1s) Row 5: "111221" (Previous has one 1s and one 2s and two 1s) Row 6: "312211" (Previous had three 1s and two 2s and one 1s)
Thank you.
how does the tree have a right side of one if they all none on the right side??
This was one of the best LeetCode explanations I have ever watched!
im new to this and this problem , although easy, gave me a major headache , cuz i did not know how to run code, and had no idea how to implement it, just to see how it works
nice explanation at the end <3
Visiting your channel after 2-3 years. Hope you are good.
// another solution, I guess faster /** * @param {number} n * @return {string} */ var countAndSay = function (n) { if (n === 1) return "1"; let finalResult = "1" for (let i = 2; i <= n; i++) { let stringInFocus = finalResult; let currentResult = ""; let counter = 1; let prevCharacterIndex = 0; let currentCharacterIndex = 1; while (!!stringInFocus[currentCharacterIndex]) { if ( stringInFocus[currentCharacterIndex] === stringInFocus[prevCharacterIndex] ) { counter++; } else { currentResult = `${currentResult}${counter}${stringInFocus[prevCharacterIndex]}`; prevCharacterIndex = currentCharacterIndex; counter = 1; } currentCharacterIndex++; } currentResult = `${currentResult}${counter}${stringInFocus[prevCharacterIndex]}`; finalResult = currentResult; } return finalResult; };
// following solution is similar to "Level order travelsal ii" var minDepth = function(root) { if(!root) return 0; if(!root.left && !root.right) return 1; let q = [root], depth = 0, isFound = false; while(q.length !== 0 && !isFound){ let nodeCount = q.length; while(nodeCount !== 0){ const current = q.shift(); if(!current.left && !current.right){ isFound = true; break; } if(current.left) q.push(current.left); if(current.right) q.push(current.right); nodeCount--; } depth++ } return depth; }
// following solution is identical to the solution of the "Balanced binary tree" var maxDepth = function(root) { if(!root) return 0; function getHeight(node){ if(!node) return 0; let left = getHeight(node.left) let right = getHeight(node.right) return Math.max(left, right) + 1 } return getHeight(root) };
var isSubsequence = function(s, t) { let pS = 0, pT = 0; while(!!s[pS] && !!t[pT]){ if(s[pS] === t[pT]){ pS++; } pT++; } return (pS - 1) === (s.length - 1) };
Well explained!
took me forever to get this
Hello TW, I have been learning Javascript at a slow pace. I am still outside of the software engineering and development universe (I don't have a job in this field, yet.). I am in my late 50s and have desired to learn code for a while. With regard to my previous attemps of learning programming, I was quite confused by the complexity of writing instructions that a computer can comprehend. Your videos have lessened the fear and confusion that I havepreviously experienced when it comes to leetcode problems. Thank you and I hope to return the favor to you, soon.
THANK YOU FOR SPEAKING NON INDIAN ENGLISH! 🙏
great explanation
didn't pay much attention and thought you coded in java :)) , anyways very good teaching , I finally understood this 1d dp
thanks
This is fantastic and I can't thank you enough for speaking calmly enough to grasp what you are saying without having to repeatedly rewind, as so many tutorials require lol. I will definitely look for more of your videos. (subscribed✔)
Thanks mate
Hmmmm
Dude, this was so helpful with the visuals on the left side breaking down the code! liked and subbed
thank you for making these! Still helpful 2 years later! Your explanations are super helpful!
var lengthOfLastWord = function(s) { return s.trim().split(" ").filter(each => each !== "").slice(-1)[0].length };
Super clear explanation!
var majorityElement = function(nums) { const half = nums.length / 2; let charMap = {} for(let each of nums){ !charMap[each] ? charMap[each] = 1 : charMap[each] += 1 if(charMap[each] > half) return each; } return -1 };
// this beats 74.79% of the leetcode solutions var intersection = function(nums1, nums2) { return Array.from(new Set(nums1.filter(each => nums2.includes(each)))) };
var intersection = function(nums1, nums2) { let finalResult = [] let nums1_uniques = new Set(nums1); for(let each of nums2){ if(!finalResult.includes(each) && nums1_uniques.has(each)){ finalResult.push(each) } } return finalResult };
Here is my regex approach to the isValidCharacter function: _function_ isValidCharacter(char) { *return* char.length === 1 && char.toLowerCase().match(/[a-z0-9]/i); }
The intro song pulls me in every time. Anyone know the name of it?
I think you should rebrand to "Terrific Whiteboard"
Why did you stop making videos?
Thank you. EXCELLENT explanation! Interview prep is such a grind sometimes... When you have questions about a problem and you can watch a 25m video and come away crystal clear.. its invaluable
Have some of the best explaination on CZcams rlly learned a lot, you should post more man would love a watch a whole DS&A playlist by you and the way you explain things with the drawings! cheers.
fantastic explanation
Slight improvement (?): You don't need the break keyword, you can just return lastWordLength and it will break out the loop
This was the best explanation among all others!
simple explanation, made a lot of sense to me
Explain why you used this mid point calculation formula.. getting confused with regular binary search
Dude. Such a great job with the explanation! Thanks so much! Also, see you haven't posted in about 2 years, hope you're doing well.
Super explanation ! Watched many videos, yours is definitely the clearest one. Thank you so much !
100%
I only understood your sol after searching all over, the way u name the var as pointer actually helped me a lot.
the best explanation I’ve ever seen so far. Great work! Thank you
Underrated channel. You are the best. Please upload more videos.
beautiful.
Hi. Why did you stop making videos?
That was really confusing to understand.
me to brother
i love your explanations and videos. subscribed!
Thank you for great explanation
Thanks Whiteboard... your not that terrible dude hahaha