ComputerBread
ComputerBread
  • Видео 20
  • Просмотров 119 503
Leetcode 1. Two Sum (Why brute force might be enough!)
Leetcode number 1. Two Sum (easy)
Let's go back to the leetcode grind, with an easy problem.
In this video, we explore how to solve this problem using 4 different algorithms.
I lead you through the entire thought process from basic brute force to the hashmap solution. I also explore why brute force is not necessarily a bad idea!!!
Leetcode playlist: ruclips.net/p/PLuJfrVx3aQbG1_9k3khnuR0r2RaxExxse
JavaScript playlist: ruclips.net/p/PLuJfrVx3aQbGQMDbtGcuIDY2892FA09b2
Leetcode question: leetcode.com/problems/two-sum/description/
Code: github.com/ComputerBread/leetcode/tree/main/1_two-sum
Cheatcheet/mindmap: ko-fi.com/s/34966c8fb1
Twitter: ComputerBread
Subscribe: www.youtube.com/@Compute...
Просмотров: 621

Видео

Should you use AI as a developer?
Просмотров 51214 дней назад
CursorAI, Claude Sonnet 3.5, GPT-4, OpenAI... should you, as a developer, use AI to do your job? In this filler episode, I am giving my opinion on whether or not developers should use AI to help them do their job. Check my previous videos about string algorithms & data structures: ruclips.net/p/PLuJfrVx3aQbFFYhYkCHLQjHEf5bmFmYAN Support me: ko-fi.com/computerbread Cheatcheet/mindmap: ko-fi.com/...
6 easy steps to get started with Neovim
Просмотров 234Месяц назад
Hello, today I wanted to share what is probably the easiest & sane way to get started with Neovim. We go over 6 steps ( 2 bonus ones) to go from 0 to hero. I hope this can be useful, please enjoy :) Links: neovim.io github.com/nvim-lua/kickstart.nvim ruclips.net/video/rT-fbLFOCy0/видео.html www.lua.org/manual/5.4/ nvchad.com Check my previous videos about string algorithms & data structures: ru...
They spent $1.8 million for you to have a friend
Просмотров 8002 месяца назад
This video is for entertainment purposes only. friend is your new AI-powered wearable that is always listening to you and texts you like a real friend. They spent $1.8 million on the domain name. Tech bros are fighting over this! What do you guy think about this? Just wanted to try making a "funnE" video about this questionable product I saw on x (twitter), maybe I should stick to tutorials! An...
Aho-Corasick Algorithm - JavaScript Implementation (pt. 2)
Просмотров 1712 месяца назад
Hello, welcome back to part 2 of the Aho-Corasick algorithm, today we implement it in JavaScript. Part 1: ruclips.net/video/XWujo7KQL54/видео.html code: github.com/ComputerBread/algorithms/blob/8fb7aa96543faa5589fda486077fb84213b1e1c7/Aho-Corasick/aho-corasick-part-2.js Videos I recommend you to watch to help you understand this one: - Intro to state machines: ruclips.net/video/5KJtYMjeY4U/виде...
Ctrl+F on steroids - Aho-Corasick Algorithm (pt. 1)
Просмотров 3612 месяца назад
Hello, today we dive into the Aho-Corasick algorithm that allows us to find multiple patterns in a text. This algorithm can be seen as a generalized version of the KMP algorithm. Part 2 (implementation): ruclips.net/video/jsgLCvOW6Vo/видео.html Videos I recommend you to watch to help you understand this one: - Intro to state machines: ruclips.net/video/5KJtYMjeY4U/видео.html - KMP algorithm: ru...
Compressed trie
Просмотров 1,1 тыс.2 месяца назад
Hello, in the previous video, we learnt about tries, today, we learn how we can decrease the number of nodes in a trie by defining a "compressed trie" aka "compact prefix tree" aka "radix tree". This video can be helpful to solve the medium Leetcode problem "208. Implement Trie (Prefix Tree)": leetcode.com/problems/implement-trie-prefix-tree/description/ There are different variations of tries,...
Trie - The data structure behind autocomplete (Prefix tree)
Просмотров 5633 месяца назад
Hello, today, we learn about "tries" aka "prefix trees", a simple data structure that can be used to store & search for strings. We implement a simple "autocomplete english dictionary" in JavaScript. This video can be helpful to solve the medium Leetcode problem "208. Implement Trie (Prefix Tree)": leetcode.com/problems/implement-trie-prefix-tree/description/ There are different variations of t...
KMP - The optimal string matching algorithm
Просмотров 1 тыс.4 месяца назад
Hello, today, we learn about the Knuth-Morris-Pratt exact string matching algorithm. It has the optimal worst-case time complexity of Big-O of m n. Where m is the length of the pattern and n is the length of the text. And it requires a reasonable extra space of Big-theta of m. This video is based on the previous video in which we constructed a Deterministic Finite Automaton (DFA) to find a patt...
The most fundamental string matching algorithm (introduction to Finite Automata)
Просмотров 2295 месяцев назад
Hello, today, we’ll discover some of the most fundamental ideas in Computer Science applied to string matching. Learning and knowing about finite state automata, deterministic and non-deterministic is fundamental if we want to be able to explore more advanced algorithms like the KMP algorithm, tries, suffix trees, Aho-Corasick, RegEx engines… Previous video about the Boyer-Moore algorithm: rucl...
The algorithm behind Ctrl+F (Boyer-Moore String Matching Algorithm)
Просмотров 2,9 тыс.6 месяцев назад
Hello, today we start our journey into “string algorithms” with the Boyer-Moore string matching algorithm. This algorithm is considered to be the most efficient one in usual applications. It uses two rules: the bad character rule & the good suffix rule. In this video I explain how they work, and how to implement them in JavaScript. You can find the full source code on github: github.com/Compute...
The unexpected complexity of characters (Unicode, UTF-8, UTF-16, UTF-32, Glyphs, Fonts)
Просмотров 3917 месяцев назад
Hello, before making videos about string algorithms, I wanted to talk about characters, how they are encoded in a binary format, what are ASCII, EBCDIC, and Unicode. What is UTF, and how UTF-8, UTF-16 and UTF-32 works. I also wanted to know how fonts work, and how characters are printed on a screen! This is an introduction before the real stuff, I hope you will enjoy it! Cheatcheet/mindmap: ko-...
Leetcode 503. Next Greater Element II
Просмотров 40110 месяцев назад
Welcome back to another boring leetcode video :) Today, it's leetcode problem 503. "Next greater element II"! leetcode.com/problems/next-greater-element-ii/ With C code explanation! I swear this is the last boring video I make, next one will be better, trust. I made a first version of this video 3 years ago, but it was bad and I didn't published it. But when I watched it recently, I decided to ...
How to draw a perfect circle (using rust)
Просмотров 10 тыс.Год назад
Not long ago I discovered the game "Perfect Circle" by Neal Fun (neal.fun/perfect-circle/). The goal is to draw a perfect circle. As a developer I accepted the challenge, and decided to build a simple bot in rust. In this video I explained how I did it, and how you can do it too. Source code: github.com/ComputerBread/draw_a_perfect_circle (Sorry for the way I talk, I recently started wearing al...
How "super" works in JavaScript
Просмотров 101Год назад
#shorts In this short, we take a look at how the keyboard "super" works under the hood. JavaScript Classes: ruclips.net/video/ATNPDFSHgns/видео.html JavaScript Playlist: ruclips.net/p/PLuJfrVx3aQbGQMDbtGcuIDY2892FA09b2
The hidden details of JavaScript Classes
Просмотров 318Год назад
The hidden details of JavaScript Classes
Master JavaScript Objects
Просмотров 274Год назад
Master JavaScript Objects
Leetcode 46. Permutations : Introduction to backtracking
Просмотров 98 тыс.4 года назад
Leetcode 46. Permutations : Introduction to backtracking
Largest rectangle in a histogram [Coding Interview]
Просмотров 1,8 тыс.4 года назад
Largest rectangle in a histogram [Coding Interview]

Комментарии

  • @solaimanhosen
    @solaimanhosen 3 дня назад

    Good to see you are making leetcode videos. I always wanted to make videos related to computer programming but couldn’t do it.

    • @ComputerBread
      @ComputerBread 2 дня назад

      I am going to make more! What's stopping you from making videos?

  • @lekamarade
    @lekamarade 3 дня назад

    Thx for vids on leet code!

  • @johnk6757
    @johnk6757 17 дней назад

    Like them or not, you will be left behind if you don't learn to use them efficiently.

  • @user-lx2ep9hd4k
    @user-lx2ep9hd4k 17 дней назад

    Can't wait when bunch of black suits realize how their mutli billion company is crashing down because it's entire infrastructure consists of millions of lines of code and nobody knows how it works. But unfortunately for them, this realization comes too late when all the slapped together code starts struggling.

  • @rachelsnijders817
    @rachelsnijders817 17 дней назад

    No, don't use a AI for anything serious, except if you have absolutely no clue what you're doing and you just want to know what a piece of code is doing. And even then it's better to ask a human than a large language model. As the person in the video noted, if you use a LLM to generate code, you should know what the code is doing. Then, you need to take out the bad, buggy code and replace it with something that works. The end result: you've spent more time reading and fixing an LLM's code and you haven't thought of a meaningful solution yourself, meaning you'll feel less satisfied with the solution. One exception to the rule is if you hate the creativity that comes with programming and love the frustration that comes with debugging. Then absolutely use LLMs when programming.

    • @johnk6757
      @johnk6757 17 дней назад

      I have found that AI seems to emit relatively few bugs (certainly fewer bugs than any random human developer), but it's great for doing tasks you've done many times before and won't learn from doing. Debugging can be extra frustrating indeed - but learning how to work efficiently with the AI output is a skill itself I do think there's something to the idea of stagnating your growth by leaning too heavily on it but I also think it can have the opposite effect, empowering developers to move MUCH more quickly and build more interesting projects to actually learn about interesting things

    • @Serizon_
      @Serizon_ 17 дней назад

      agreed

    • @rachelsnijders817
      @rachelsnijders817 17 дней назад

      @@johnk6757 But if you've already done something, then surely you've made a component out of it? I can't think of anything that can be automated with LLMs but not with traditional code.

  • @Xtreme-yb9yo
    @Xtreme-yb9yo 17 дней назад

    i dont think i can run an llm locally on my 2019 macbook with a whopping 4gb vram

    • @ComputerBread
      @ComputerBread 16 дней назад

      Yeah, you're cooked, even with a RTX3080 I am struggling to run one!

  • @thoniasenna2330
    @thoniasenna2330 18 дней назад

    hahahah i love you! best regards from brazil!

  • @lekamarade
    @lekamarade 19 дней назад

    Ok

  • @bd_dev
    @bd_dev 22 дня назад

    Excellently explain! and +1 for the animations 👍

  • @mustafabouras-r5w
    @mustafabouras-r5w 27 дней назад

    dude you are the best

  • @f4zer_
    @f4zer_ 28 дней назад

    simple & easy !! loved it, we need more. thanks.

  • @stoup8778
    @stoup8778 Месяц назад

    I really like your soln, very clear explanation. I didnt think of using a seperate vector to keep track of used elements either - I tried to used a set when I was implementing on my own and failed miserably haha

  • @harshchauhan5514
    @harshchauhan5514 Месяц назад

    Kickstart is amazing and should be starting point of each vimmer tbh. Also the kickstart-modulor fork is great too.

  • @10xDevLog
    @10xDevLog Месяц назад

    Great video! Thanks for this

  • @grandparick3176
    @grandparick3176 Месяц назад

    Problem: I have windows

    • @ComputerBread
      @ComputerBread Месяц назад

      Time to switch to linux! But you should be able to make it work on Windows, I think, maybe?

    • @lekamarade
      @lekamarade Месяц назад

      Maybe in wsl?

    • @harshchauhan5514
      @harshchauhan5514 Месяц назад

      I have windows I first started with kickstart first two months before and then after in wsl I'm configuring my own. I have done half configured to this point (started this Sunday). Once you are done with kickstart move to kickstart go in kickstart-modulor fork it's more ezy to understand stages of config.

  • @christianjt7018
    @christianjt7018 Месяц назад

    The backtracking recipe is pure golden, this is a superb explanation, thank you.

  • @Tlj10144
    @Tlj10144 Месяц назад

    What's up with the 188 dislikes lol

    • @ComputerBread
      @ComputerBread Месяц назад

      it's 191 now T_T

    • @Tlj10144
      @Tlj10144 Месяц назад

      @@ComputerBread fuck them, you should do more videos like this

  • @WearyWayfarer
    @WearyWayfarer Месяц назад

    Yikes

  • @popcornbuster752
    @popcornbuster752 Месяц назад

    CIA's listening device

  • @mac3362
    @mac3362 Месяц назад

    whup. we are fucked. good luck, humanity. it's been fun

  • @kevinz3200
    @kevinz3200 Месяц назад

    Looks like the end of social interaction, please delete it.

    • @phillipsmusic3871
      @phillipsmusic3871 Месяц назад

      That's the only right thing to do in this sad situation.

  • @ComputerBread
    @ComputerBread 2 месяца назад

    Part 2 is available here: ruclips.net/video/jsgLCvOW6Vo/видео.html

  • @Yarin5879
    @Yarin5879 2 месяца назад

    thank you so much

  • @trimansinghtuteja4199
    @trimansinghtuteja4199 2 месяца назад

    That was a great explanation!!

  • @robertkovac7824
    @robertkovac7824 2 месяца назад

    thanks

  • @ayomide-michael
    @ayomide-michael 2 месяца назад

    Subscribed!

    • @ComputerBread
      @ComputerBread 2 месяца назад

      Thank you 😀I appreciate it!

  • @atxorsatti
    @atxorsatti 2 месяца назад

    Perhaps I would have gone over a deletion function as well, there are some gotaches there

    • @ComputerBread
      @ComputerBread 2 месяца назад

      I thought about it, maybe in another video

  • @atxorsatti
    @atxorsatti 2 месяца назад

    I just finished implementing compact radix tree as a base for an inverted index for a full text project, this video would have been a great help for me, dang

    • @ComputerBread
      @ComputerBread 2 месяца назад

      Maybe next time I will have a better timing! A full text project, that sounds cool, are you building a database or something like that?

  • @Adityarm.08
    @Adityarm.08 2 месяца назад

    Linear time suffix tree construction (Ukkonen's algorithm) is interesting, do look into it once you get a chance.

  • @jungwisely1137
    @jungwisely1137 3 месяца назад

    Great Explanation

  • @BungisZeCat
    @BungisZeCat 3 месяца назад

    when i runned the program it didnt work it just like the cursor went rfully right pls help me

    • @ComputerBread
      @ComputerBread 3 месяца назад

      Did you change the coordinates? this line: let (x_c, y_c) = (2881.0, 555.0); ? (I am using a 2nd monitor placed on the right) Try something like: let (x_c, y_c) = (950.0, 555.0);

    • @BungisZeCat
      @BungisZeCat 3 месяца назад

      @@ComputerBread thank you so much it worked❤

  • @mahdimurshed3314
    @mahdimurshed3314 3 месяца назад

    Very well put! Thank you.

  • @lekamarade
    @lekamarade 3 месяца назад

    Thx

  • @KietTuan-ss2co
    @KietTuan-ss2co 3 месяца назад

    Tôi lên 96.7%

  • @hoangvu-zu6qg
    @hoangvu-zu6qg 3 месяца назад

    Really thanks to you, guy. This video made me more understand about backtracking.

  • @darshandani1
    @darshandani1 4 месяца назад

    Thanks for this. Great explanation !

  • @kushagrashuklaietlucknowst5642
    @kushagrashuklaietlucknowst5642 4 месяца назад

    Damn most comprehensive video for its duration

  • @hwstar9416
    @hwstar9416 4 месяца назад

    is this really optimal in practice? I feel like allocating a new buffer would cause this algorithm to perform worse in some cases.

    • @ComputerBread
      @ComputerBread 4 месяца назад

      Asymptotically yes, in practice probably not, I've read somewhere (can't remember where) that Boyer-Moore is 25% faster on english text. In some cases, brute force can probably be faster.

  • @harry8588
    @harry8588 4 месяца назад

    It’s really hard to understand you. Your videos look interesting but you need to speak clearer and with crisper audio

    • @ComputerBread
      @ComputerBread 4 месяца назад

      Yeah, I've been struggling to have good audio but I didn't thought it was that bad. I will try my best to get better!

    • @harry8588
      @harry8588 4 месяца назад

      I’ve never tried doing a recording but I can imagine it’s tricky! Just a bit more feedback, I think it’s less about the microphone/editing but more the pronunciation of the words, they seem to just blend together which is why it’s hard for me (a native English speaker) to understand fully. Please keep it up though, your videos look high quality and the topics are interesting!

    • @ComputerBread
      @ComputerBread 4 месяца назад

      @@harry8588 Ok thank you :)

  • @mateusvmv
    @mateusvmv 4 месяца назад

    Looks like an Aho-Corasick for a single pattern

    • @ComputerBread
      @ComputerBread 4 месяца назад

      It is, Aho-Corasick can be seen as an extension of the KMP algorithm. I actually made this video to introduce the concept of "failure links", so I can explain the Aho-Corasick algorithm more easily. Aho-Corasick = trie + failure links + output links

  • @ComputerBread
    @ComputerBread 4 месяца назад

    Hello everyone! I hope you will enjoy this video! In the previous video, we built a DFA to find a pattern in a text. The KMP algorithm reduces the memory usage of this DFA by introducing the idea of "failure links". Failure links, also called suffix links, appear in other algorithms that we will discover in future videos! (Check description for videos & code links)

  • @JMac___
    @JMac___ 5 месяцев назад

    i love you man, this made a lot of sense to me and your backtracking building block helped me come to 90% of solution on my own

  • @amitmehraa
    @amitmehraa 5 месяцев назад

    Great video!

  • @tranpaul4550
    @tranpaul4550 5 месяцев назад

    Oh my God, It just clicked, all the time studying backtracking pattern

  • @emanuelrollin2930
    @emanuelrollin2930 5 месяцев назад

    less comedy please 😭

    • @ComputerBread
      @ComputerBread 5 месяцев назад

      Ok, no fun allowed, I am sorry

  • @k.k.harjeeth5422
    @k.k.harjeeth5422 6 месяцев назад

    This video deserves 1M views

    • @ComputerBread
      @ComputerBread 6 месяцев назад

      Haha, I like your enthusiasm, maybe one day! but for now I am glad you enjoyed it

  • @xecreth7211
    @xecreth7211 6 месяцев назад

    Very cool topic

  • @kauefragadev
    @kauefragadev 6 месяцев назад

    Awesome approach and demonstration!!

  • @gwentarinokripperinolkjdsf683
    @gwentarinokripperinolkjdsf683 6 месяцев назад

    Great break down

  • @MLMLML41910
    @MLMLML41910 6 месяцев назад

    How do you use it