NeetCode
NeetCode
  • 355
  • 51 420 012
The LeetCode Fallacy
🚀 neetcode.io/ - A better way to prepare for coding interviews
Checkout my second Channel: www.youtube.com/@NeetCodeIO
🧑‍💼 LinkedIn: www.linkedin.com/in/navdeep-singh-3aaa14161/
📷 Instagram: neetcodeio
🥷 Discord: discord.gg/ddjKRXPqtk
🐦 Twitter: neetcode1
🎵 TikTok: www.tiktok.com/@neetcode.io
"Sappheiros - Fading" is under a Creative Commons license (CC BY 3.0) / ua-cam.com/users/Sappheiros
Music promoted by BreakingCopyright: ua-cam.com/video/uhqMKpppnpo/v-deo.html
#coding #neetcode #python
Переглядів: 363 323

Відео

Most Common Concepts for Coding Interviews
Переглядів 262 тис.7 місяців тому
The fastest way to prepare for coding interviews: prioritize the most common data structures and algorithms. 🚀 neetcode.io/ - Get lifetime access to every course I ever create! Checkout my second Channel: www.youtube.com/@NeetCodeIO 🌎 neetcode.io/roadmap - Coding Interview Roadmap 📃 neetcode.io/practice - Neetcode 150 🧑‍💼 LinkedIn: www.linkedin.com/in/navdeep-singh-3aaa14161/ 🥷 Discord: discord...
Leetcode 24 Hour Challenge (while learning Golang)
Переглядів 115 тис.7 місяців тому
Coding leetcode problems for 24 hours straight because I enjoy the pain. And I get to learn about Golang, which is such a great language for leetcoding. 🚀 neetcode.io/ - A better way to prepare for coding interviews Checkout my second Channel for daily uploads: www.youtube.com/@NeetCodeIO 🧑‍💼 Connect on LinkedIn: www.linkedin.com/in/navdeep-singh-3aaa14161/ 🥷 Discord: discord.gg/ddjKRXPqtk 🐦 Tw...
I quit Amazon after two months
Переглядів 555 тис.7 місяців тому
Sharing my story of working at Amazon and being unemployed for over a year. 🚀 neetcode.io/ - A better way to prepare for coding interviews. Checkout my second Channel for daily uploads: www.youtube.com/@NeetCodeIO 🧑‍💼 LinkedIn: www.linkedin.com/in/navdeep-singh-3aaa14161/ 🥷 Discord: discord.gg/ddjKRXPqtk 🐦 Twitter: neetcode1 📷 Instagram: neetcodeio 0:00 - Intro 0:36 -...
I coded a Leetcode clone (it's easier than you think)
Переглядів 134 тис.8 місяців тому
I coded a leetcode clone (an online code judge application, not literally a leetcode clone). I walk through how I did it, including the backend, frontend, and the process of executing test cases. 🚀 neetcode.io/ - Get lifetime access to every course I ever create! Checkout my second Channel: www.youtube.com/@NeetCodeIO 🧑‍💼 LinkedIn: www.linkedin.com/in/navdeep-singh-3aaa14161/ 🐦 Twitter: twitter...
Google's Tech Stack (6 internal tools revealed)
Переглядів 300 тис.9 місяців тому
Google's internal tech stack is mostly public and we talk about 6 of the most influential infrastructure tools used at google, either currently or in the past. 🚀 neetcode.io/ - A better way to prepare for coding interviews 📝 neetcode.io/courses/lessons/design-youtube - UA-cam Skeleton Design Doc MongoDB Cheat sheet: neetcode.io/courses/lessons/mongodb MongoDB Atlas - tinyurl.com/kae79pew Tools ...
My Last Day at Google
Переглядів 546 тис.11 місяців тому
I left Google earlier this year, after working there for about 1.5 years as a software engineer. 🚀 neetcode.io/ - A better way to prepare for coding interviews! Checkout my second Channel: @NeetCodeIO 🥷 Discord: discord.gg/ddjKRXPqtk 🧑‍💼 LinkedIn: www.linkedin.com/in/navdeep-singh-3aaa14161/ 🐦 Twitter: neetcode1 📷 Instagram: neetcodeio 🎵 TikTok: www.tiktok.com/@neetco...
My Brain after 569 Leetcode Problems
Переглядів 2,4 млнРік тому
🗺️ Roadmap: neetcode.io In this video I wanted to share every single thing I learned from solving and explaining hundreds of leetcode problems. Quiz Feature: neetcode.io/ 🚀 neetcode.io/ - A better way to prepare for coding interviews! Second channel: @NeetCodeIO 🧑‍💼 LinkedIn: www.linkedin.com/in/navdeep-singh-3aaa14161/ 🥷 Discord: discord.gg/ddjKRXPqtk 🐦 Twitter: neetcode1 📷 Instagr...
GPT-4 is OVERHYPED
Переглядів 116 тис.Рік тому
🚀 neetcode.io/ - A better way to prepare for coding interviews! Checkout my second Channel: @NeetCodeIO 🧑‍💼 LinkedIn: www.linkedin.com/in/navdeep-singh-3aaa14161/ 🥷 Discord: discord.gg/ddjKRXPqtk 🐦 Twitter: neetcode1 📷 Instagram: neetcodeio 🎵 TikTok: www.tiktok.com/@neetcode.io #coding #neetcode #python
20 System Design Concepts Explained in 10 Minutes
Переглядів 840 тис.Рік тому
🚀 neetcode.io/ - A better way to prepare for coding interviews! A brief overview of 20 system design concepts for system design interviews. Checkout my second Channel: @NeetCodeIO 🧑‍💼 LinkedIn: www.linkedin.com/in/navdeep-singh-3aaa14161/ 🥷 Discord: discord.gg/ddjKRXPqtk 🐦 Twitter: neetcode1 📷 Instagram: neetcodeio 🎵 TikTok: www.tiktok.com/@neetcode.io 0:00 - Intro 0:...
Google will DESTROY ChatGPT in 2023
Переглядів 217 тис.Рік тому
🚀 neetcode.io/ - A better way to prepare for coding interviews! Meet Bard - Google's answer to ChatGPT and Microsofts new changes to bing and edge. Will this AI war between tech giants lead to faster automation of jobs? Let's discuss. 🧑‍💼 LinkedIn: www.linkedin.com/in/navdeep-singh-3aaa14161/ 🥷 Discord: discord.gg/ddjKRXPqtk 🐦 Twitter: neetcode1 📷 Instagram: neetcodeio...
8 Design Patterns EVERY Developer Should Know
Переглядів 977 тис.Рік тому
🚀 neetcode.io/ - A better way to prepare for coding interviews! Checkout my second Channel: @NeetCodeIO While some object oriented design patterns are a bit outdated, it's important for every software engineer to understand the most important ones. I cover several of my favorite ones in this video. Code from video: neetcode.io/courses/lessons/8-design-patterns 🧑‍💼 LinkedIn: www.linkedin.com/in/...
Technologies I'm Learning in 2023
Переглядів 165 тис.Рік тому
🚀 neetcode.io/ - Get lifetime access to every course I ever create! The technologies I'm planning on learning next year. I feel like some parts of this came off a bit rushed / confusing, so let me know if you have questions. Checkout my second Channel: @NeetCodeIO 🧑‍💼 LinkedIn: www.linkedin.com/in/navdeep-singh-3aaa14161/ 🥷 Discord: discord.gg/ddjKRXPqtk 🐦 Twitter: neetcode1 📷 Insta...
The BEST Coding Interview Roadmap in 2023 (free)
Переглядів 367 тис.Рік тому
🚀 neetcode.io/ - Checkout the FREE roadmap! Checkout my second Channel: @NeetCodeIO 🧑‍💼 LinkedIn: www.linkedin.com/in/navdeep-singh-3aaa14161/ 🥷 Discord: discord.gg/ddjKRXPqtk 🐦 Twitter: neetcode1 📷 Instagram: neetcodeio 🎵 TikTok: www.tiktok.com/@neetcode.io #leetcode #roadmap #coding
Will AI replace programmers?
Переглядів 176 тис.Рік тому
Will AI replace programmers?
Design Youtube - System Design Interview
Переглядів 241 тис.Рік тому
Design UA-cam - System Design Interview
Is FAANG dead?
Переглядів 115 тис.Рік тому
Is FAANG dead?
Design Twitter - System Design Interview
Переглядів 443 тис.Рік тому
Design Twitter - System Design Interview
Mock Google Coding Interview with a Meta Intern
Переглядів 850 тис.Рік тому
Mock Google Coding Interview with a Meta Intern
Tech Layoffs & Hiring Freezes
Переглядів 337 тис.Рік тому
Tech Layoffs & Hiring Freezes
Anatomy of a Production App - System Design
Переглядів 109 тис.Рік тому
Anatomy of a Production App - System Design
Big-O Notation - For Coding Interviews
Переглядів 387 тис.Рік тому
Big-O Notation - For Coding Interviews
Python for Coding Interviews - Everything you need to Know
Переглядів 365 тис.Рік тому
Python for Coding Interviews - Everything you need to Know
Dynamic Programming 2D - Full Course - Python
Переглядів 99 тис.Рік тому
Dynamic Programming 2D - Full Course - Python
Dynamic Programming 1D - Full Course - Python
Переглядів 224 тис.Рік тому
Dynamic Programming 1D - Full Course - Python
Maximum Performance of a Team - Leetcode 1383 - Python
Переглядів 28 тис.Рік тому
Maximum Performance of a Team - Leetcode 1383 - Python
Construct String from Binary Tree - Leetcode 606 - Python
Переглядів 32 тис.Рік тому
Construct String from Binary Tree - Leetcode 606 - Python
How I Coded a SaaS (payments, database and frontend)
Переглядів 135 тис.Рік тому
How I Coded a SaaS (payments, database and frontend)
Count Vowels Permutation - Dynamic Programming - Leetcode 1220 - Python
Переглядів 40 тис.Рік тому
Count Vowels Permutation - Dynamic Programming - Leetcode 1220 - Python
Tech Stack I use at Google as a Software Engineer
Переглядів 408 тис.Рік тому
Tech Stack I use at Google as a Software Engineer

КОМЕНТАРІ

  • @Piggybacking
    @Piggybacking Годину тому

    even though I am watching this video, still can't get it..

  • @pulakdas3216
    @pulakdas3216 2 години тому

    Hi bro.. do u have the solution to "Best time to buy and sell stock III"... I am in dire need of it!!... The other solutions in the internet are totally going above my head!!

  • @edwardteach2
    @edwardteach2 2 години тому

    U a God

  • @sangeetjena5486
    @sangeetjena5486 3 години тому

    Can you share the solution for "688. Knight Probability in Chessboard " using dp

  • @rapscalliondave
    @rapscalliondave 3 години тому

    This is wrinkling my brain.

  • @yomamasofat413
    @yomamasofat413 3 години тому

    After doing a few of these challenges, coding feels like tricks to manipulate stuff to get what you want. So different from other subjects

  • @SLOANchetan
    @SLOANchetan 3 години тому

    acid compliance😅

  • @NavyaJyothiG
    @NavyaJyothiG 4 години тому

    This code throws an error. You can't append to a int.

  • @prabhatmishra7784
    @prabhatmishra7784 4 години тому

    How come this O (n) complexity? there are two internal loops. For an example: for nums = [8,7,6 ,5, 4, 3, 2, 1] could be worst case time complexity scenario ie o(n^2)

  • @OmarElghamry1
    @OmarElghamry1 5 годин тому

    So at 25 y.o, now I get how multiplication is done.This proves the whole education system is fucked.

  • @spiceybyte
    @spiceybyte 6 годин тому

    Nice solution i used a hash map instead

  • @raghul6884
    @raghul6884 7 годин тому

    yea everything you told was fine..except you gotta know that Java handles the user input in a more efficient way than the other 2

  • @user-xv8ru8ny2v
    @user-xv8ru8ny2v 7 годин тому

    wouldnt it be easier to have a left array and a right array. Left contains the products of all elements left of that element except itself. Same goes for the right. leftArray = [1,1,2,6] rightArray = [24,12,4,1]. Then just multiply each corresponding element of leftArray to the rightArray to get outpur array = [24,12,8,6]

  • @AnshDedha
    @AnshDedha 8 годин тому

    Thanks!

  • @sophiophile
    @sophiophile 9 годин тому

    For the first problem, I guess the only optimization (beyond knowing the math eq) would be selecting the smaller of m and n, so that your memory complexity is minimized.

  • @foreverbowie2720
    @foreverbowie2720 11 годин тому

    why my first thought is tying to write the dictionary mapper from letter to number.....

  • @Vertek11235
    @Vertek11235 12 годин тому

    Please do more SQL 🙏

  • @sophiophile
    @sophiophile 12 годин тому

    Can we improve the efficiency at 2:24:28 by mutating wordDict into the form where the key is len(word) and the value is a list of all words of that length (no extra space). Then we can check: for key in wordDict: if i+key in dp and dp[i + key] = True: for word in wordDict[key]: #check the word That way, you eliminate the vast majority of building dp.

  • @sophiophile
    @sophiophile 12 годин тому

    2:08:59 why is the third value in the min necessary (just n). cur_max can never be less than 1. If cur_max is 1, its the same as n, if its larger, it's bigger than n.

  • @sabukuna
    @sabukuna 12 годин тому

    var checkInclusion = function(s1, s2) { if (s2.length<s1.length) return false; let map1 = makeHashmap(s1, 0, s1.length); let map2 = makeHashmap(s2, 0, s1.length); let matches = 0; for (let [key, val] of map1.entries()) { if(map2.get(key) == val) matches++; } if(matches == map1.size) return true; for (let i = 1; i < s2.length-s1.length+1; i++) { let oldVal = s2[i-1]; let newVal = s2[i+s1.length-1]; if (map1.has(oldVal)) { if(map2.get(oldVal) === map1.get(oldVal)) matches--; map2.set(oldVal, map2.get(oldVal) - 1); if(map2.get(oldVal) === map1.get(oldVal)) matches++; } if (map1.has(newVal)) { if(map2.get(newVal) === map1.get(newVal)) matches--; map2.set(newVal, (map2.has(newVal) ? map2.get(newVal) : 0) + 1) if(map2.get(newVal) === map1.get(newVal)) matches++; } if(matches === map1.size) return true; } return false; }; var makeHashmap = function(string, start, end) { const hash = new Map(); for(let i = start; i < end; i++){ hash.set(string[i], (hash.has(string[i]) ? hash.get(string[i]) : 0) + 1) } return hash }

  • @TheRomanianWolf
    @TheRomanianWolf 13 годин тому

    Very good video!!! Thanks!

  • @bendhiebhassen5144
    @bendhiebhassen5144 14 годин тому

    thank you it is very helpful🤩🤩🤩

  • @codedoctor3265
    @codedoctor3265 14 годин тому

    BFS , More intuitive solution class Solution(object): def canFinish(self, numCourses, prerequisites): """ :type numCourses: int :type prerequisites: List[List[int]] :rtype: bool """ graph = defaultdict(list) in_degree = [0] * numCourses for course, prereq in prerequisites: graph[prereq].append(course) in_degree[course] += 1 # Step 2: Initialize the queue with courses having in-degree of 0 queue = deque([i for i in range(numCourses) if in_degree[i] == 0]) # Step 3: Process the courses using BFS processed_courses = 0 while queue: current_course = queue.popleft() processed_courses += 1 # Reduce the in-degree of neighboring courses for neighbor in graph[current_course]: in_degree[neighbor] -= 1 # If in-degree becomes 0, add it to the queue if in_degree[neighbor] == 0: queue.append(neighbor) # Step 4: Check if all courses are processed return processed_courses == numCourses

  • @ShailPM
    @ShailPM 15 годин тому

    does the goat respond

  • @furkanozyurt6845
    @furkanozyurt6845 15 годин тому

    Thank you right man right your explanation right is very right clear right but I wish right you use right the word of "right" right less right.

  • @XxM1G3xX
    @XxM1G3xX 16 годин тому

    I don't think you can say O(log26) for the maxHeap, since it's not just one appearance per letter, it is task.length < 10^4, so there could be 10^4 pops * idle queue

  • @recneps1000
    @recneps1000 16 годин тому

    It’s actually possible to construct the adjacency list in linear time. First create a set of the word list, then for every char in every word try all the letters from the alphabet and check if it’s in the set. If it is then add it to the adjacency list for that word. Great video!

  • @servantofthelord8147
    @servantofthelord8147 17 годин тому

    I finally understand it! Thank you!

  • @jamestruong3320
    @jamestruong3320 17 годин тому

    Hi Neet, loved the solution- it was very concise and simple. One thing I would add to the explanation is that you made it seem like it was a breadth first solution instead of a depth first solution inside your diagram segment. The for-loop executes after each backtracking return, not when they are called. In other words, the next iteration of the for loop is only executed after the first completed string.

  • @user-dw6vs1li8q
    @user-dw6vs1li8q 17 годин тому

    after seeing the thumbnail i thought its a fireship video

  • @briankramer7162
    @briankramer7162 19 годин тому

    I kept waiting for him to actually describe the work and the process of how he got disengaged at Amazon. Seems like he was more eager to talk about his drug use. Becoming a great software engineer takes a lot of dedication, focus, and stamina. Forget the drugs and learn to really dig writing code.

  • @uknownkoala7994
    @uknownkoala7994 20 годин тому

    Farmers daily life is far mor excited and spontaneous than CS these days, and the gains enough to feed a big family alone.With modern tech farming is not tough like it was a the hell. I know this.Farming is more usefull too and more ethical than CS, and more freedom adn social interactions, i know that!

  • @theeraphatsunthornwit6266
    @theeraphatsunthornwit6266 21 годину тому

    I thought i might not work in some scenario, but seem i am wrong.

  • @lokeshnandanwar9203
    @lokeshnandanwar9203 21 годину тому

    Java Code without causing a Time limit Exceeded in Leetcode class Solution { public List<String> findItinerary(List<List<String>> tickets) { LinkedList<String> iternary = new LinkedList<>(); Map<String,PriorityQueue<String>> graph = new HashMap<>(); Stack<String> stack = new Stack<>(); stack.push("JFK"); for(List<String> ticket : tickets){ graph.computeIfAbsent(ticket.get(0), k->new PriorityQueue<String>()); graph.get(ticket.get(0)).add(ticket.get(1)); } while(!stack.isEmpty()){ String destination = stack.peek(); if(!graph.getOrDefault(destination, new PriorityQueue<String>()).isEmpty()){ stack.push(graph.get(destination).poll()); } else{ iternary.addFirst(stack.pop()); } } return iternary; } }

  • @saikrishnag8641
    @saikrishnag8641 21 годину тому

    yoy desreve 10M followers . Your explanation is simply superb

  • @EranM
    @EranM 22 години тому

    wow. simply fkn wow with the pos diag neg diag.. such a nice pattern to this.. holy moly. neet! 1337!!

  • @Hiroprotagonist253
    @Hiroprotagonist253 23 години тому

    brilliant!!!!

  • @Thiru7unknown
    @Thiru7unknown День тому

    literally this is insaneeee

  • @neighboroldwang
    @neighboroldwang День тому

    I still don't get why does (self.isSameTree(p.left, q.left)) works. Could someone explain a bit?

  • @neighboroldwang
    @neighboroldwang День тому

    Could someone explain a little bit what does 0 and 1 in "balanced = left[0] and right [0] and abs(left[1] - right[1] <= 1)" mean?

  • @kafka5973
    @kafka5973 День тому

    Guys you can solve this problem using hash set very easily

  • @hamzaislam7620
    @hamzaislam7620 День тому

    Similar events happened to me at the level of detail that it is uncanny (and at around the same time 2018-2019ish.) I actually started my CS journey after the darker paranoia stuff. Funny how we both ended up on LeetCode at the end of the day. Cheers to you friend for sharing your story. Time for me to lock in and do some LeetCode!

  • @TheDoc-Worker
    @TheDoc-Worker День тому

    Dogg, I have been waiting for someone to explain the learning process using analogy to ML models--it's something I think about a lot, it seems *so* many people just have no idea how to teach themselves anything, how to think about learning itself, and a lot could really benefit from recognizing it is a fairly predictable process that need not generate any anxiety at all. People talk about banging their head against the wall for hours trying to figure a single problem out, and I just feel bad for them. I never, ever do that, and yet always (eventually) succeed at learning anything I want to--because I understand that it simply isn't necessary, any more than a neural network learning how to, say, complete a trackmania level *needs* to reach the finish line every single iteration--the whole point is to fail repeatedly with incremental improvement. Waste no time beating yourself up over something you don't know, just note "okay there's still a gap there" and move on. Come back to it later armed with a little more surrounding knowledge. Explore, approach the topic from multiple angles, pursue points of personal curiosity that provide precious motivation--as long as you continue processing relevant information, *your understanding of a topic WILL eventually gel into a functional model without ever needing to look complete at any point earlier along the way!*. That could be worded much more clearly but I don't feel like it right now. However, by making this one attempt to verbalize this concept now, I am certain I have made incremental progress toward being capable of explaining it very articulately in the future. No stress!

  • @subhajitmaji752
    @subhajitmaji752 День тому

    import java.util.*; class Solution { public int maxSubArray(int[] nums) { int sum=nums[0]; int max=Integer.MIN_VALUE; max=Math.max(max,sum); if(sum<0) sum=0; for(int i=1;i<nums.length;i++){ sum+=nums[i]; max=Math.max(max,sum); if(sum<0) sum=0; } return max; } }

  • @stringjourney
    @stringjourney День тому

    Once the logic explanation was done...code looks easy peasy Great work.

  • @manojboganadham9071
    @manojboganadham9071 День тому

    Liked immediately after seeing Naruto reference

  • @nourishcherish9593
    @nourishcherish9593 День тому

    def numDecodings(self, s: str) -> int: if s[0] == '0': return 0 n = len(s) dp = [0] * (n + 1) dp[0], dp[1] = 1, 1 for i in range(2, n + 1): one = int(s[i - 1]) two = int(s[i - 2:i]) if 1 <= one <= 9: dp[i] += dp[i - 1] if 10 <= two <= 26: dp[i] += dp[i - 2] return dp[n] this is more like understandable dp tbh

  • @shalinisangal84
    @shalinisangal84 День тому

    Great explanation, with ur explanation feeling like it was so easy. Thank u so much

  • @rodo2220
    @rodo2220 День тому

    Why can't I just reverse the list using slicing? I'm still pretty new to coding, but it seems hella easier to just type out head[::-1] and call it a day. I'm guessing it has something to do with the time complexity?

  • @ajajajaj686
    @ajajajaj686 День тому

    A recursive solution is more intuitive but of course, is not O(1) in terms of extra space.