Deleted scene: five words with twenty-five letters

29,845
0
Published 2022-08-03

All Comments (21)
  • @ysakhno
    Actually I would be interested to hear you explaining every non-trivial line of your solution in this much detail.
  • @motmahp
    I'm surprised to find I wasn't subscribed to the main channel, but one consequence is that I watched the second video first. 😀
  • @ilRosewood
    WAIT! Bec was in the room?! I'm stunned.
  • @olivier2553
    My instinctive approach would be to use set, star with one word, try to find a second one compatible, then when trying to find the third word, only continue from the point in the word list that we already reached, because we know that previous words in the list were already deemed incompatible (having duplicate letters), etc. never go back to the beginning of the list of words. So the list should be scanned only once for each 1st word.
  • @NoNameAtAll2
    instead of calculating len of union you could have tested if intersection (&) is empty
  • @ror3D
    Using the sets is very intuitive, but sets are slow data structures, which is probably slowing the algorithm biiig time. A very good way to do this same check that can potentially be a lot faster (I don't know in python but in C/C++ it would certainly be) is by encoding the letters in a word as a bit field. It fits all in a normal integer (32 bits) and you can just bit-wise-and the value for each pair of words, if it's 0 then they don't share letters, if different than 0 then they share one or more letters.
  • @lio1234234
    Didn't get the notification for the first one, did for this one. Saw this one first, great explanation and super useful, thanks!
  • @i_Hally
    Enjoyed the main video immensely and very much appreciate every extra morsel
  • Oh no. I started watching this one before the first channel, but I realized it was for a video I hadn't watched so I left to go watch the first channel. I can't believe I missed the chance to be called a maverick.
  • @Corrup7ioN
    "don't send me ways I could've improved it"
  • @grapetoad6595
    First watched this, now to get some context. For some reason YT only recommended this one and not the main
  • I got the notification for this video and not the main channel so started this one and went wait a minute 😅
  • @NotHPotter
    Shorter video generally gets watched first, so here I am. Almost got me to pause and go back to get context from the first video, but I stuck through it.
  • @Raptremrum
    I watched this first, was very confused what was going on, so I watched the main channel, then went back after I understood the problem and noticed the modified ending. Do you always do that or is it new?
  • I like you too! This popped up in my recommended without the original so now I'm gonna watch the other video.
  • @traywor1615
    Whaat? I was soo ssure, that it were actual pictures and I was just imagining the little movement. Also now, the perfectly timed giggles, no longer look like magic acting skills anymore. So S.A.D.
  • @juneguts
    But have you found any words with 25 unique letters? What is the longest string of unique letters that comprises a valid word?
  • @Sparky5869
    I watched second video first because I went through my subscriptions, adding everything to my "watch later" list from top to bottom, since I was on mobile, and that is reverse order :P It's usually fine bc most channels only upload one video a day and they're rarely related to their previous video
  • @error13660
    I think I have a better idea for filtering out anagrams: What if you associated every letter with a unique prime number (like: a-> 2 b-> 3 c->5 ...) and for every word you multiplied together the associated numbers of its letters. This way you would get a unique number for each letter combination without considering the order. So you would put this created number in a list (or a hash map for better performance) and every time you have a new word, you would just have to convert it into a number this way and check if the number exists in the list. If it does, the word is an anagram, if not it is unique.