Alejandro Iglesias Llobet
Alejandro Iglesias Llobet
  • Видео 160
  • Просмотров 21 965
NEETCODE Challenge #23 - Plus One
Welcome to Day 23 of me solving each and every problem of the NeetCode 150! Today, we're solving Problem 66 - Plus One.
🔗 Problem Link: leetcode.com/problems/plus-one/
🚀 Explore NeetCode 150 full problem list and guides: neetcode.io/practice
📂 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode
📅 Join me 3x per week on Mondays, Wednesdays and Fridays for a new NeetCode problem!
📌 A full breakdown of the dates that I'll be solving each problem is now pinned in the comments section below!
TIMESTAMPS
00:00 Problem Solving
02:34 First Accepted Solution
05:07 Solution Explanation
If you enjoy this content, feel free to like and subscribe for more problem-solving videos!
#LeetCode #NeetCo...
Просмотров: 4

Видео

Daily LeetCode Challenge (Day 127): Take K of Each Character From Left and Right
Просмотров 2715 часов назад
Welcome to Day 127 of my Daily LeetCode Challenge until I reach 1 year's worth of green contributions on GitHub! Today, we're solving Problem 2516 - Take K of Each Character From Left and Right. 🔗 Problem Link: leetcode.com/problems/take-k-of-each-character-from-left-and-right/ 🚀 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode 📅 Join me daily for a new LeetCode problem! 🔐 L...
Daily LeetCode Challenge (Day 126): Maximum Sum of Distinct Subarrays With Length K
Просмотров 662 часа назад
Welcome to Day 126 of my Daily LeetCode Challenge until I reach 1 year's worth of green contributions on GitHub! Today, we're solving Problem 2461 - Maximum Sum of Distinct Subarrays With Length K. 🔗 Problem Link: leetcode.com/problems/maximum-sum-of-distinct-subarrays-with-length-k/ 🚀 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode 📅 Join me daily for a new LeetCode proble...
NEETCODE Challenge #22 - Happy Number
Просмотров 414 часа назад
Welcome to Day 22 of me solving each and every problem of the NeetCode 150! Today, we're solving Problem 202 - Happy Number. 🔗 Problem Link: leetcode.com/problems/happy-number/ 🚀 Explore NeetCode 150 full problem list and guides: neetcode.io/practice 📂 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode 📅 Join me 3x per week on Mondays, Wednesdays and Fridays for a new NeetCode...
Daily LeetCode Challenge (Day 125): Defuse the Bomb
Просмотров 1024 часа назад
Welcome to Day 125 of my Daily LeetCode Challenge until I reach 1 year's worth of green contributions on GitHub! Today, we're solving Problem 1652 - Defuse the Bomb. 🔗 Problem Link: leetcode.com/problems/defuse-the-bomb/ 🚀 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode 📅 Join me daily for a new LeetCode problem! 🔐 LeetSync extension to automatically upload LeetCode solutio...
Daily LeetCode Challenge (Day 124): Shortest Subarray with Sum at Least K
Просмотров 1024 часа назад
Welcome to Day 124 of my Daily LeetCode Challenge until I reach 1 year's worth of green contributions on GitHub! Today, we're solving Problem 862 - Shortest Subarray with Sum at Least K. 🔗 Problem Link: leetcode.com/problems/shortest-subarray-with-sum-at-least-k/ 🚀 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode 📅 Join me daily for a new LeetCode problem! 🔐 LeetSync extensi...
Daily LeetCode Challenge (Day 123): Find the Power of K-Size Subarrays I
Просмотров 419 часов назад
Welcome to Day 123 of my Daily LeetCode Challenge until I reach 1 year's worth of green contributions on GitHub! Today, we're solving Problem 3254 - Find the Power of K-Size Subarrays I. 🔗 Problem Link: leetcode.com/problems/find-the-power-of-k-size-subarrays-i/ 🚀 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode 📅 Join me daily for a new LeetCode problem! 🔐 LeetSync extensio...
NEETCODE Challenge #21 - Meeting Rooms
Просмотров 5912 часов назад
Welcome to Day 21 of me solving each and every problem of the NeetCode 150! Today, we're solving Problem 252 - Meetings Rooms. 🔗 Problem Link: leetcode.com/problems/meeting-rooms/ 🚀 Explore NeetCode 150 full problem list and guides: neetcode.io/practice 📂 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode 📅 Join me 3x per week on Mondays, Wednesdays and Fridays for a new NeetC...
Daily LeetCode Challenge (Day 122): Shortest Subarray to be Removed to Make Array Sorted
Просмотров 7012 часов назад
Welcome to Day 122 of my Daily LeetCode Challenge until I reach 1 year's worth of green contributions on GitHub! Today, we're solving Problem 1574 - Shortest Subarray to be Removed to Make Array Sorted. 🔗 Problem Link: leetcode.com/problems/shortest-subarray-to-be-removed-to-make-array-sorted/ 🚀 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode 📅 Join me daily for a new LeetC...
Daily LeetCode Challenge (Day 121): Minimized Maximum of Products Distributed to Any Store
Просмотров 5614 часов назад
Welcome to Day 121 of my Daily LeetCode Challenge until I reach 1 year's worth of green contributions on GitHub! Today, we're solving Problem 2064 - Minimized Maximum of Products Distributed to Any Store. 🔗 Problem Link: leetcode.com/problems/minimized-maximum-of-products-distributed-to-any-store/ 🚀 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode 📅 Join me daily for a new L...
NEETCODE Challenge #20 - Min Cost Climbing Stairs
Просмотров 2716 часов назад
Welcome to Day 20 of me solving each and every problem of the NeetCode 150! Today, we're solving Problem 746 - Min Cost Climbing Stairs. 🔗 Problem Link: leetcode.com/problems/min-cost-climbing-stairs/ 🚀 Explore NeetCode 150 full problem list and guides: neetcode.io/practice 📂 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode 📅 Join me 3x per week on Mondays, Wednesdays and Fr...
Daily LeetCode Challenge (Day 120): Count the Number of Fair Pairs
Просмотров 7116 часов назад
Welcome to Day 120 of my Daily LeetCode Challenge until I reach 1 year's worth of green contributions on GitHub! Today, we're solving Problem 2563 - Count the Number of Fair Pairs. 🔗 Problem Link: leetcode.com/problems/count-the-number-of-fair-pairs/ 🚀 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode 📅 Join me daily for a new LeetCode problem! 🔐 LeetSync extension to automat...
Daily LeetCode Challenge (Day 119): Most Beautiful Item for Each Query
Просмотров 14019 часов назад
Welcome to Day 119 of my Daily LeetCode Challenge until I reach 1 year's worth of green contributions on GitHub! Today, we're solving Problem 2070 - Most Beautiful Item for Each Query. 🔗 Problem Link: leetcode.com/problems/most-beautiful-item-for-each-query/ 🚀 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode 📅 Join me daily for a new LeetCode problem! 🔐 LeetSync extension to...
NEETCODE Challenge #19 - Climbing Stairs
Просмотров 6621 час назад
Welcome to Day 19 of me solving each and every problem of the NeetCode 150! Today, we're solving Problem 70 - Climbing Stairs. 🔗 Problem Link: leetcode.com/problems/climbing-stairs/ 🚀 Explore NeetCode 150 full problem list and guides: neetcode.io/practice 📂 Check out my GitHub for all solutions: github.com/Jackbar21/Leetcode 📅 Join me 3x per week on Mondays, Wednesdays and Fridays for a new Nee...
Daily LeetCode Challenge (Day 118): Prime Subtraction Operation
Просмотров 9321 час назад
Welcome to Day 118 of my Daily LeetCode Challenge until I reach 1 year's worth of green contributions on GitHub! Today, we're solving Problem 2601 - Prime Subtraction Operation. 🔗 Problem Link: leetcode.com/problems/prime-subtraction-operation/ 🔗 Sieve of Eratosthenes: ruclips.net/video/klcIklsWzrY/видео.htmlsi=hFiW5_T3jftP6AYq 🚀 Check out my GitHub for all solutions: github.com/Jackbar21/Leetc...
Daily LeetCode Challenge (Day 117): Shortest Subarray With OR at Least K II
Просмотров 69День назад
Daily LeetCode Challenge (Day 117): Shortest Subarray With OR at Least K II
Daily LeetCode Challenge (Day 116): Minimum Array End
Просмотров 72День назад
Daily LeetCode Challenge (Day 116): Minimum Array End
NEETCODE Challenge #18 - Last Stone Weight
Просмотров 29День назад
NEETCODE Challenge #18 - Last Stone Weight
Daily LeetCode Challenge (Day 115): Maximum XOR for Each Query
Просмотров 65День назад
Daily LeetCode Challenge (Day 115): Maximum XOR for Each Query
Daily LeetCode Challenge (Day 114): Largest Combination With Bitwise AND Greater Than Zero
Просмотров 90День назад
Daily LeetCode Challenge (Day 114): Largest Combination With Bitwise AND Greater Than Zero
NEETCODE Challenge #17 - Kth Largest Element in a Stream
Просмотров 6614 дней назад
NEETCODE Challenge #17 - Kth Largest Element in a Stream
Daily LeetCode Challenge (Day 113): Find if Array Can Be Sorted
Просмотров 14714 дней назад
Daily LeetCode Challenge (Day 113): Find if Array Can Be Sorted
Daily LeetCode Challenge (Day 112): Minimum Number of Changes to Make Binary String Beautiful
Просмотров 16614 дней назад
Daily LeetCode Challenge (Day 112): Minimum Number of Changes to Make Binary String Beautiful
NEETCODE Challenge #16 - Subtree of Another Tree
Просмотров 5414 дней назад
NEETCODE Challenge #16 - Subtree of Another Tree
Daily LeetCode Challenge (Day 111): String Compression III
Просмотров 25314 дней назад
Daily LeetCode Challenge (Day 111): String Compression III
Daily LeetCode Challenge (Day 110): Rotate String
Просмотров 15814 дней назад
Daily LeetCode Challenge (Day 110): Rotate String
Daily LeetCode Challenge (Day 109): Circular Sentence
Просмотров 18314 дней назад
Daily LeetCode Challenge (Day 109): Circular Sentence
NEETCODE Challenge #15 - Same Tree
Просмотров 4414 дней назад
NEETCODE Challenge #15 - Same Tree
Daily LeetCode Challenge (Day 108): Delete Characters to Make Fancy String
Просмотров 25114 дней назад
Daily LeetCode Challenge (Day 108): Delete Characters to Make Fancy String
Daily LeetCode Challenge (Day 107): Minimum Total Distance Traveled
Просмотров 18914 дней назад
Daily LeetCode Challenge (Day 107): Minimum Total Distance Traveled

Комментарии

  • @Improve_myself-783
    @Improve_myself-783 4 часа назад

    Respect++ 🫡🫡

  • @deerajthakkilapati1030
    @deerajthakkilapati1030 15 часов назад

  • @bogus3007
    @bogus3007 17 часов назад

    used a set for this one worked well

    • @alejandroill
      @alejandroill 16 часов назад

      Oh actually?! How’d you handle the case where you have more than one instance of an element in the current window then?

    • @bogus3007
      @bogus3007 Час назад

      @@alejandroill i removed the element until i could add the current one again. example: [1,5,4,2,9,9,9] once i'm at [4,2,9] then the next element is also 9, so I remove 4, then 2, then 9, and then add 9 (a loop that checks for this) ''' while nums[end] in unique or end - start + 1 > k: unique.remove(nums[start]) cur_sum -= nums[start] start += 1 '''

    • @alejandroill
      @alejandroill 35 минут назад

      @bogus3007 Ah I see, you preemptively delete even more elements when you encounter duplicates, that’s pretty smart!! Way to go man! 👊

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

    For the DRY part. int l = 1; if (k < 0) { l = code.Length + k; k *= -1; } int r = l; Where l is used to subtract and r to add and in every subtract/add iteration you modulo with code len.

    • @alejandroill
      @alejandroill День назад

      Ayyy thank you broski, I was just too lazy after the mental toll yesterdays problem took on me 🫠 Pinning this comment for everyone to see 😎

    • @Improve_myself-783
      @Improve_myself-783 День назад

      Thanks 🙏

  • @Improve_myself-783
    @Improve_myself-783 2 дня назад

    Nice bro i am your new subscriber i also want to pro like you in DSA I am currently learning DSA in java Is it worth learning???? Plz reply bro 😭

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

      Hey, thank you so much for subscribing!! In my opinion, Java is a great language to code DSA with, and the one that I started with myself :) In the end I did end up switching to Python, just because it allows me to think more about the problem instead of language specifics. I.e. if you don't know any languages, then Python is probably best way to go, but otherwise the best language is the one you're most comfortable with! As long as you learn basic things such as creating & using certain data structures like HashSet<T> class and etc, you'll be totally fine :) If you do want to try out Python however, one of the best videos I've ever watched regarding the things you need to know about Python for Leetcoding is the following: ruclips.net/video/0K_eZGS5NsU/видео.htmlsi=COwJt0uhRDs4Vb2c Let me know what you decide, and remember the most important step is to start!! Don't dwell too much about which language to use, that matters much less, and if you want to stick to Java that's an absolutely perfect choice :) I'll be looking forward to seeing how your journey goes!! 😁

    • @Improve_myself-783
      @Improve_myself-783 2 дня назад

      @@alejandroill Thanks for your reply bro 🛐 And I don't have any idea about python so I am continuing my journey with java Thanks for help 🙏

    • @alejandroill
      @alejandroill День назад

      Of course, and Java is a fantastic choice!! What matters the most is that you start 😇 Feel free to keep me updated on how the journey goes as you go along, I’d love to keep hearing from you!! Best of luck brother ❤️

  • @bogus3007
    @bogus3007 6 дней назад

    getting the three sample test cases rly got me hype with like 4 lines but only passed half of cases

    • @alejandroill
      @alejandroill 5 дней назад

      Haha that’s always the worst 🫠 Although usually in those cases I feel either (1) you’re really close and just missing a few edge cases or (2) you tried a greedy solution that is not correct for all edge cases. Did you figure it out in the end??

  • @notbalding
    @notbalding 7 дней назад

    Basically had the same struggles, had the idea but executing was a bit iffy. I didn't see the 2 pointer solution. I iterate over the array grab a lower bound and upper bound with Binary Search and do calcs based on that.

    • @alejandroill
      @alejandroill 7 дней назад

      Haha yeah, at least we got it!! And wdym by lower & upper bound? 🤔

    • @notbalding
      @notbalding 7 дней назад

      @alejandroill So my intuition was i do 2 Binary Searches to get a range and add that to result. The first is the lower bound, second is the upper bound. Example when num is 4 with lower 5, upper 10. The lower bound would be 1 and the upper bound would be 6. We try to search those in our array and add the range if it's available.

    • @alejandroill
      @alejandroill 6 дней назад

      @notbalding Ah I see, do you have to make this call for every number in nums then? And for each then find the range, do (j-i+1)(j-i+2)/2 and subtract 1 from each numerator product in case num itself is in range? That’s a super cool solution!

    • @notbalding
      @notbalding 6 дней назад

      @@alejandroill Yea a call gets made for every num, could add a memo but i doubt that it's worth it. BS is most likely faster than hashmap lookup. I'll just add part of the source code. the predicates are so you find the left or right most duplicate incase there are. ```cs int lower_target = lower - nums[i]; int upper_target = upper - nums[i]; int lower_bound = Search(nums, lower_target, x => x < lower_target, x => x >= lower_target); int upper_bound = Search(nums, upper_target, x => x <= upper_target, x => x <= upper_target); if (lower_bound == -1) continue; lower_bound = Math.Max(lower_bound, i + 1); if (lower_bound > upper_bound) continue; output += upper_bound - lower_bound + 1; ``` can paste it in discord if you like some color.

    • @alejandroill
      @alejandroill 5 дней назад

      Ah that’s smart, and haha I forgot you code in C#! That’s actually super cool 😁

  • @deerajthakkilapati1030
    @deerajthakkilapati1030 7 дней назад

    I'm back!!!

  • @noornasri5753
    @noornasri5753 8 дней назад

    You're getting faster

  • @vildanhuseynov6492
    @vildanhuseynov6492 8 дней назад

    wow. i did not think about binary search. instead i solved using min heap and eventually it seems bs more optimal solution.

    • @alejandroill
      @alejandroill 7 дней назад

      Haha yeah! I think it helps that I’ve coincidentally been solving a bunch of binary search problems from the Neetcode 150 lately, so I was able to almost instantly-recognize it 😅 Thinking of things as potentially sorteded array of booleans helps a lot!!

  • @bogus3007
    @bogus3007 8 дней назад

    super cool way to think about optimizing

    • @alejandroill
      @alejandroill 8 дней назад

      Haha thank you! Greedy stays ahead 😎

  • @saketh8937
    @saketh8937 9 дней назад

    I wanted to ask why are you solving all easy ones first rather than going topic wise? Do you find the prior method to work better?

    • @alejandroill
      @alejandroill 9 дней назад

      This is the order that was recommended to me by a friend of mine when I started my Leetcode journey 2 years ago, and even by Neetcode himself I believe (before creating his Roadmap and etc.) Doing it by problem difficulty has a few advantages, and in fact there’s a medium article that explains it better than I can 😅: “”” I want to reiterate again that what you choose is up to you, but I would highly recommend doing them in order of difficulty. The reason for this is that it will ease you into the list better than doing it topic by topic. If you start by completing one topic at a time, then you will be doing hard questions from the start which can put off your tempo. Additionally the hard question require more time and knowledge so you might feel discouraged slowing down for them earlier on, but once you have the foundation of doing all the medium and easy questions in the list, they are much more manageable. Doing the list by topic also means that you won’t see topics again for the rest of the 150, depriving you of the chance to revise them. Reiterating on previously done topics to solidify your knowledge of them is critical in the learning process, which you won’t be doing as much if you do the list in order of topic. So, to sum up this section, I highly recommend doing the NeetCode 150 in order of difficulty and not in order of topic. “”” Article Link: medium.com/@theconnoisseur/how-you-should-approach-the-neetcode-150-a-kickstart-guide-b88b59819108

    • @saketh8937
      @saketh8937 8 дней назад

      @alejandroill thanks for the info! I'll try it out.

    • @alejandroill
      @alejandroill 8 дней назад

      Awesome!! 👏

  • @saketh8937
    @saketh8937 9 дней назад

    Lol... always feels good when we find multiple solutions especially cheeky ones

  • @javierlim96
    @javierlim96 10 дней назад

    We just have to check if the initial array and sorted array, when mapped to the number of bits are the same.

    • @alejandroill
      @alejandroill 9 дней назад

      That’s exactly right! I wish I realized that while I was solving it :(

  • @bogus3007
    @bogus3007 13 дней назад

    hate bitwise, but this one was better, couldn't figure out the shifting left for the life of me so I just used a list for this and did regular right shifts for each pos

    • @alejandroill
      @alejandroill 13 дней назад

      Hahaha, and darn I didn’t even think of going bit shifts!! I just treated them all as strings via bin(…) function 😋😅 I love getting to see your comment everyday, thank you for doing this ☺️ (gets a little lonely sometimes… 🫠)

  • @devashu7
    @devashu7 13 дней назад

    Hey Alejandro, I am 14 yo and currently I am doing DSA through C language. WILL C language be worth it for the future in search of an internship or shall I learn python? Please clear my doubt😢.

    • @bogus3007
      @bogus3007 13 дней назад

      bro if youre 14 and doing DSA it doesnt matter what you use.. but id recommend python for interviewing, maybe projects in C could be cool

    • @devashu7
      @devashu7 13 дней назад

      @@bogus3007 Thanks a lot man:)

    • @alejandroill
      @alejandroill 13 дней назад

      (I’m cooking up a response, just might be a minute since it’s a long one!) Edit: My reply is too large to fit in a single comment, so I’ll split it across two comments here below 👇

    • @alejandroill
      @alejandroill 12 дней назад

      Hey Ashu, first of all I want to congratulate you for starting so young at 14 years old, that’s absolutely incredible!! 🥳 A lot of my friends, myself included, really wished we started programming before going to University for Computer Science. You’re already ahead of the curb!! As for your question, it’s rather simple to answer, but depends majorly on what your goals are. I’ll start off with the pros and cons of C and Python, since you seem mostly focused on these two. As a fair warning, these two languages could not be more opposite from each other: Firstly, I'll highlight the difference between low vs high level languages, as C is a low-level language, whereas Python is a high-level language. A computer at the end of the day, only understands electricity: electricity "on", and electricity "off". We use transistors and logical gates to simulate logic, but essentially computers are able to use this on/off state of electricity to be able to understand binary: 0s and 1s, where '0' means electricity off, and '1' means electricity on. As humans, we cannot think in terms of 0s and 1s like computers can, so we develop languages that we do understand, and then take time to translate them into 0s and 1s so that the computer itself can understand them. So coding in 0s and 1s, which no one really does, would be the "lowest level" form of programming. Above that there is assembly, which humans can understand and write in, which then will be translated into an equivalent program in 0s and 1s once finished. Above assembly there is C, where when you write a C program, you will need to "compile" (translate) it into an assembly program, which will then be translated into 0s and 1s via opcode instructions, which the computer can finally understand and run for you. As you can imagine, the higher level a language is, usually the easier it is to write in, but the more costly and slow it becomes due to those translation steps that are needed to convert into 0s and 1s. Python is an interpreted language which is a little different (translates the code line by line instead of all at once to be ran as an assembly file like C), but for now you can think of it as Python needing to be translated into C code, that needs to be translated into assembly code, that needs to be translated into 0s and 1s. In principle: The higher the level of a language, the easier it is to code in for the developer, but at the cost of loss-in-performance. C is a very low-level language, whereas Python is a very high-level language. Now as for which I'd recommend between the two: C: C is again a low-level language, that I'd recommend mostly if you're looking to become as prepared as possible for Computer Science in University. Since C is low-level, proficiency in C will require you to deeply understand how memory works inside the computer, how pointers work, ensuring you collect your own "garbage" (free-up memory by your own volition instead of having it handled for you), and more. It is also the language I recommend if your goal is to enter a profession such as ethical hacking or systems programming, where the more low-level experience and understanding of how computers work under-the-hood, the better. If you understand C it will not be too difficult to learn C++, which is still fast enough (especially compared to languages like Python) to be used in the worlds most high-frequency environments, such as Quant Firms where every millisecond of juice in throughput you can get highly matters. Python: Python is again a high-level language, whereas maybe not as performant as C, provides a much friendlier developer experience. I'd recommend Python if its your first programming language, or you want to begin building cool stuff such as via rasberry pis, games with PyGame, your own scripts for personal purposes or automation, or even data science / backend development for internships using frameworks like Flask or Django for backend development, Numpy & Pandas for data science work including Pytorch or Tensorflow for machine learning, etc etc. Just in the world of internships, if you could ONLY pick between Python and C, Python would definitely be the way to go in my honest opinion. It is also my recommended language of choice if its your first programming language. It is a very flexible and versatile language for many things, and since many things in life don't require the utmost amount of juiceable performance as humanely possible out of a computer, it turns out Python is rather excellent for many use cases in the software development world. Also, if your goal is to become proficient in DSA & Leetcoding, it depends on your goals, but if its for maximizing learning outcomes I bet you can probably guess my answer -- but I'd recommend python as it just helps save on a LOT of the thinking for you, but I will admit that a great majority of competitive programmers leverage C++ for even better performance. Now as for my two cents, if you're 14 and looking to learn programming, have some fun with it, dwelve into a bunch of topics and see what you like, then without a doubt I would recommend Python. It really depends on what motivates you as a person, though if you are very internship-motivated, then it's a slightly different story. Personally, if I was starting over absolutely from scratch with zero knowledge about programming, I'd recommend a roadmap like this: (1) If you have absolutely no knowledge of programming (which I don't think is your case!), then I'd start off very small and go through this video in full: ruclips.net/video/rfscVS0vtbw/видео.htmlsi=jtrA8g4M-xdaoWKB. I love Mike Dane, and this is the exact resource that I used to teach myself the basics of programming in Python before my very first programming course in University 😊 (2) Second, once you have at least some familiarity with programming, i.e. you understand control flow via if statements, for & while loops, etc., then in my opinion there is absolutely no better place to learn than Harvard's CS50 course. I watched this course on my own for fun, and the first half is an almost near-exact replica of the CSCA48 course that I took at the University of Toronto (where I studied). The second half of CSCA48 focused even harder into elementary computer science knowledge, whereas the second half of CS50 focuses on learning how to build stuff, learning SQL, python, javascript, development work, and etc -- which I think even fits better with your goals!! I mainly LOVE this course because it does start off with C (after Scratch), teaches you the core foundations of how memory works with computers, pointers, easing into storing memory via arrays, realizing their limitations, introducing you into linked lists, then seeing those limitations, into then BSTs, and only then once you have the absolute fundamentals down -- going into the world of developing cool stuff with software 🙂 If you're interested, here is a link to a playlist of all the lectures for you to watch & learn from: ruclips.net/p/PLhQjrBD2T382_R182iC2gNZI9HzWFMC_8&si=DkMuPloW2Ya3JP6p. I HIGHLY HIGHLY HIGHLY recommend this resource, especially since you're 14 and starting out into the Computer Science world, having this foundational knowledge of programming & computers is an UNBELIEVABLE advantage at your age, especially if you're looking to go into Computer Science for University, and build a foundation for coding to build off of before starting to work on projects and entering the internship/job world.

    • @alejandroill
      @alejandroill 12 дней назад

      (3) At this point, assuming you've gone through CS50, you have access to the knowledge I had (and more!) as when I just finished my 1st year of Computer Science at the University of Toronto (and about to go into my 2nd year). This is the time where I recommend you can go into the project-building world, starting maybe with a niche that you'd like to explore. I will say some niches might be harder than others, i.e. learning game development with Unreal framework in C++ might be more challenging than learning about front-end web development with a framework like React. At this phase, you have many options. You can go into the web development world, for which I would ABSOLUTELY RECOMMEND the course by Dr. Angela Yu titled "The Complete 2024 Web Development Bootcamp" on Udemy. It's not free and you'll have to pay a bit of money, but if you're willing to do so, make sure you wait for a sale on Udemy as they happen OFTEN and you can usually snatch up the course for <$20 instead of the default price it's listed at (which is usually >$100). It was the resource I used to learn web development from scratch, and boy can I say one of the greatest investments in myself that I have ever made. Dr. Angela Yu is a FANTASTIC teacher, and also has more courses that I've never tried (but I'm sure are also excellent), such as a 100 days of Python course! If you do go through this web development route and realize that you absolutely love it, and especially on the React side of things (which was one of my favourite parts of the course), I'd recommend a followup course such as "React - The Complete Guide 2024 (incl. Next.js, Redux) by Maximillian Schwarzmuller also on Udemy. If web isn't really your thing, another area is mobile development! What's nice is that if you did do a course like the Dr. Angela Yu Web Development one above, that you'll have some good practice and knowledge around React, so you can already get your hands down and dirty with something like React Native, which allows for cross-platform development. If you're not sure what that means, that's okay, essentially there's two main phone operating systems used nowadays: iOS and Android. If you want to purely learn iOS development, which I believe does require you to own a macBook, you can do so via Xcode in the Swift language, in fact Dr. Angela Yu's expertise is in iOS development (not web development!) and has a course on it as well up on Udemy! Otherwise you could learn something like Android mobile development via Android Studio in Java (or Kotlin nowadays), or a third option which is cross-platform development: these apps will always be slower than their native counterparts (i.e. an app designed for Android coded in Kotlin / an app designed for iOS coded in Swift), but have the advantage that it can be used in either phone operating system and app store. For cross platform development there are many options, including Flutter, but one of which again is React Native, which will translate on over very nicely if you now have that Web Development experience in React from Dr. Angela Yu 😁 Otherwise there are many other fields you can go into as well, such as game development, cloud computing (like me!), but in my opinion either Web or Mobile Development is probably one of the best ways for a beginner to get their foot-in-the-door into the software industry, so especially for you if you have the goal of landing internships, I think they can be a very solid and foundational choice. I would definitely still recommend starting with something like CS50 at the start to build some of that foundational knowledge, it's like learning how to shoot a free-throw or a layup in basketball before getting to the cool stuff like learning how to dunk or make fade-away shots haha 😋 The important part is to start developing projects, as with these you can not only have a lot of fun, but a lot of learning, and also things to start showcasing on your resume for employers to see as you begin applying for internships. You have a long road ahead of you, and if there's anything you take away from this, it's be curious and just keep trying new things! Some of the smartest, most talented developers I've met throughout my college years were because they started when they were younger, particularly in things such as building games in Roblox with Lua, since they liked to play Roblox as kids! No matter what you do, I'm sure you'll be absolutely incredible, I myself sure wish I chose to learn a little bit about coding when I was just 14 years old! You've got this Ashu, I hope my advice comes in useful to you in any way, shape, or form, and I really just want to applaud you for starting so early 👏 I'll be looking forward to how your journey progresses, I'd love to watch you grow as time progresses, so be sure to keep me updated!! Best of luck to you ❤️

  • @deerajthakkilapati1030
    @deerajthakkilapati1030 13 дней назад

    I tried bubble sort for adjacent swap with swap only when they have same number of set bits but run time is high. from I tried grouping them based on set bit. it worked when i run but failed for some test cases when i submit.

    • @alejandroill
      @alejandroill 13 дней назад

      Ahhhh that’s really smart, I was trying to come up with a way to do what I was doing but whilst modifying the array to make it go even faster. Bubble sort is unironically perfect here 😂 And wdym grouping by set bit, could you clarify? 🤔 I suppose you could split the array by set bit groups, then check if they’re each sorted? Or wait if they’re all same bit in a group, then 100% you “can” sort it. So then you just have to make sure that the max of this group is less-than-or-equal to min of next group? Or wait, then you just need to get min & max of every group, which you can all do with a singular O(n) parse… DUDE YOU’RE A GENIUS!! I’m literally on the bus on my way home right now, you just made me realize how to do it in O(n) time 🤯 I’ll have to try and see if that works at home, but if so they definitely should have upped the constraints on the problem! That’s an EXTREMELY clever solution, thank you so much for sharing it 🥰 I’ll pin this again for everyone to see!!

  • @bogus3007
    @bogus3007 14 дней назад

    took me so so long, tried adding the number of set bits to an array and do the check that way and check the max and min of whichever set bit number but after 40+ mins didn't get it. rip

    • @alejandroill
      @alejandroill 13 дней назад

      Noooooo, don’t give up!! I think I get what you mean, the pinned comment actually made me realize how to solve this in O(n) time as I was reading it 😅 Were you able to solve it using an O(n^2) approach?! One way I realize now is to just do bubble sort, and at any point if you’re not able to perform a needed operation (I.e. set bit counts are unequal between two numbers you need to swap), then return False. Otherwise, you were able to sort the array, hence return True :)

  • @punk5513
    @punk5513 15 дней назад

    I also thought this was super hard😅

    • @deerajthakkilapati1030
      @deerajthakkilapati1030 15 дней назад

      Yes! Until I realise that it’s simpler than I thought!

    • @punk5513
      @punk5513 15 дней назад

      @deerajthakkilapati1030 yeah bro it happens😅

    • @alejandroill
      @alejandroill 14 дней назад

      Haha, I was also surprised when the simple-approach solution actually worked :p After the fact, it makes sense though!!

  • @notbalding
    @notbalding 15 дней назад

    Wrote the solution, thought 'surely it is not that short' and got surprised that it got accepted.

  • @bogus3007
    @bogus3007 15 дней назад

    I also tried doing some funny stuff that got about half of the cases, but as soon as i hit the hint i got it. commenting everyday doing this challenge too

    • @alejandroill
      @alejandroill 15 дней назад

      Hahaha, what did the hint say?? And aww it makes me so happy to hear that, I’ll be looking forward to reading your comment every video 🥰

    • @bogus3007
      @bogus3007 14 дней назад

      ​@@alejandroill The hint said to think in the smallest possible even integer ps. my name is also Alejandro.

    • @alejandroill
      @alejandroill 13 дней назад

      Ahh I see, yeah that definitely helps 😋 And no way, where are you from if I may ask?? I know I have a Spanish name, but I’m actually from France… 😅

  • @deerajthakkilapati1030
    @deerajthakkilapati1030 15 дней назад

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

    You just earned a new subscriber

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

    wow this man is a godddd will you be my hero babyyyy

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

      OSMANYYYYYYYY!!! What’s up my man?! Nice Enrique Iglesias reference 👨 But don’t think for a minute this means you’ll get to skip tomorrows daily with me, I got my eye on you sir 🤨🫵

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

    lfg

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

    Very amazing how you work thru the problem

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

    How about checking length of both strings is equal and if it is then use string concatenation and check if one is substring of other if yes then true else false

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

      Ahhh checking the string lengths first is definitely super smart 😂 Concatenating s against itself first is super clever!! I wonder if you get any time complexity benefit by leveraging the problem of finding out if a string is substring of another. I suppose you could sliding window efficiently to find all strings that are permutations inside the larger string, and only check those, but still O(n)… 🤔 Even if it’s O(n) though, that solution is definitely far better than mine!! Thank you so much for sharing, I’ll pin your comment for others to see as well!! 🤗

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

    totally loved it brother!!

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

      Thank you so much!! I’ll keep the videos coming 😊

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

    im dying, you said you didnt have time to waste but spent nearly 1 minute talking about how you didn't have time

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

      Hahaha I was debating whether I should keep going or not in my mind 😂 Now at the party… everyone is arriving late 🫠

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

      @@alejandroill😂

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

    Too short video bro, not interesting. I expected a two-hour video.

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

    cool

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

    🔥🔥🔥🙌

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

    I’m going to watch every single video of you from now on!!! Well I’ll learn too!!! So Keep doing ❤

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

      Aww thank you so much! That really means a lot to me! 🥺 I’ll keep on going with you!! Are you currently preparing for technical interviews, or doing this out of fun / sharpening your skills? I’d love to know 😁

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

      @@alejandroill I'm graduating this December and currently in technical interview prep. I wasn't always consistent with daily practice, but then I randomly came across you on my feed-it felt like perfect timing! Now, I've started doing it in parallel to keep myself on track.

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

      Oh no way, that’s amazing to hear!! It felt SOOOOOOOOOO amazing to FINALLY graduate from University, I’m sure it’ll feel equally amazing for you!! 😂 Huge congratulations for making it to the end of your degree!! 🥳👏 And yes!! Feel free not only to use my channel to have a buddy to code alongside daily with Leetcode, but also chatting or leaving questions down in the comments like you are now!! I will always make sure to respond to every single comment while I can on this channel, that’s a promise 🤗 In my opinion consistency is key, and the secret to success for many things in life - Leetcode included!! If you’re able to solve problems alongside me on daily, weekly, or even monthly basis for a prolonged period of time, I have no doubt that the two of us together will become absolute BEASTS of Leetcode 😎 Let me know how the journey goes, and I’ll be looking forward to hearing from you in my next videos from time to time :)

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

    🔥🔥🔥🫡

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

    Yo subbed🙌🔥🫡

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

      Yooooo thank you!! 😎🔥🔥

  • @vekoko
    @vekoko 25 дней назад

    good resource here buddy, thanks

  • @mahdirahman6222
    @mahdirahman6222 26 дней назад

    I trie-d so hard

    • @alejandroill
      @alejandroill 25 дней назад

      Hahaha, so there was a way to solve this with a Trie?! How did you do it, is it more efficient?

  • @vacel964
    @vacel964 26 дней назад

    😃

  • @sujith_TwiceOnce
    @sujith_TwiceOnce 26 дней назад

    good approach dude, definitely better than just copying from the solutions.

    • @alejandroill
      @alejandroill 25 дней назад

      Thank you so much, and definitely agree :) Understanding the solution <<< discovering the solution for learning outcomes!

  • @anshulbhati4439
    @anshulbhati4439 26 дней назад

    Love from India 🇮🇳

  • @anshulbhati4439
    @anshulbhati4439 26 дней назад

    Bro cover all leetcode questions cover i watch everyday your video

    • @alejandroill
      @alejandroill 25 дней назад

      Thank you so much!! It makes me so happy to hear that ☺️ I’ll keep the videos coming your way every single day 😁

  • @EverAfterBreak2
    @EverAfterBreak2 27 дней назад

    Congrats for the 100 days!! Hope you get well soon.

    • @alejandroill
      @alejandroill 27 дней назад

      Thank you so much!! ☺️ I can’t believe I’m already in 3 digits category, it feels just like yesterday that I started this challenge!!

  • @sanjayghanagiri5492
    @sanjayghanagiri5492 27 дней назад

    This is crazy

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

    I wasted time by doing q2 the smart O(n) way cuz for some reason I thought 26*n^2 would tle. Q3 was kinda obvious if you know how to use sieve of eratosthenes to calculate the smallest prime factor for every number. Then the greatest proper divisor is just number/spf[number]. The only trick part was realizing iterating from the back instead of the front.

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

      Hahaha yeah, I saw constraint of max 3000 and immediately knew n^2 would work :p Usually in the contests I’ve noticed that for Q2, you rarely have to bother making it efficient - but for Q3 (and esp Q4) you always do. The O(n) way I suppose would be start with starting index i, find smallest index j where (i,j) substring is valid, add length of string - j to result, increment i, increment j as much as you need to, repeat and end up with O(n)? I.e. sliding window and/or two pointers kind of idea? Curious what you did :-) Oooh I’ve never heard of “sieve of eratosthenes” before, I see it’s used to find list of prime numbers up to a certain limit… I’m gonna watch Khan Academy’s video on it right now, seems like a cool little trick to have under my belt 😊 I didn’t realize until after the problem that all numbers are either prime or divisible by prime (except 1), so definitely makes sense why this works to me now 😅 That’s a really clever solution, I appreciate you for sharing it! You seem to be very mathematically mature, how long have you been solving Leetcode problems if I may ask? Do you do it for fun, or for a specific goal you’re working towards?

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

      ​@@alejandroill​@alejandroill Yeah I did q2 the same way you mentioned. Yes, sieve is a pretty handful and well known technique to find prime numbers/factors quickly, it is quite frequent in cp contests, so I know. I have been doing LC for over a year and I am currently 2070. Hoping to reach guardian. 😅 I would suggest you to also try codeforces or atcoder contests at least the beginner ones. Would help you to improve a lot faster on LC contests imo. 😊

    • @alejandroill
      @alejandroill 29 дней назад

      I just watched the video on how it’s implemented - I’m shocked at how simple it actually is 😅 These are the cool tips & tricks that I love learning on the way as I go through this Leetcode journey :) AND DAAAAAAAAANG, you’re cracked dude!! I gotta get my way over to knight first haha 😂😅 I’ll definitely have to check out code forces as well, if I can convince my friend Noor to do it with me then sign me up 😎 It’s always a good motivator to compete with a friend, especially when they’re better than you 😂 (not salty at all… 🫠)

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

    Intresting solution with the short circuits, I do think you've made it very complicated for yourself by keeping track of the parentheses. My solution was to keep pushing onto the stack and pop till I found a closing parentheses. When you pop, pop and calc the result till you find a '&', '|' or '!' and push the calculated result back on the stack. At the end there should only be 1 char in the stack and that is your result.

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

      Omggggg, that’s super clever!! Basically you’re always solving/simplifying the inner-most expression, so you don’t have to worry about nested expressions with more commas messing you up!! I didn’t think of that, that’s a really cool solution :)

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

    Congrats on the 100%. 🎉 Even more impressive since you're using python.

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

      Yooooo thank you so much! To be fair it’s kinda lucky I earned it, the solution was literally just brute force + caching… 😂

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

    Hey I love these videos thanks

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

      Thank you so much!! I’ll keep them coming your way 😊

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

    Did not know you were british. They were too mild on the constraints for a medium.

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

      Haha that was just me having a little bit of fun 😅 I’m from France actually :) And ahhhhhh I just checked again, the number is up to 10^8 not the number of digits, so it’s at most 9 digits. Does that mean you’re able to just get away with trying to swap every two pairs of numbers and returning the biggest result? 😂

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

      @@alejandroill haha, that's what I did after I got annoyed by the use cases.

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

      @notbalding Hahaha I might have done the same if I looked at the constraints more closely 😆 If they wanted to force O(n) all they had to do was make input a string, so in my opinion this was fair game 😎

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

      @@alejandroill yea I agree, the weird part is they have done it for other problems and some are marked as easy. Just tells you how consistent they are with rating their problems.

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

      Haha yeah, Leetcode problem difficulties aren’t always the most accurate… 🫠