- 77
- 11 232
Road To FAANG
Приєднався 27 лют 2024
Leetcode 3387 | Maximize Amount After Two Days of Conversions | Weekly Contest 428
Donate: buymeacoffee.com/roadtofaang
Submission: leetcode.com/submissions/detail/1479630843/
🚀 Mastering LeetCode: Maximize Amount After Two Days of Conversions | Road To FAANG
Welcome to Road To FAANG! In this video, we'll dive deep into solving the Maximize Amount After Two Days of Conversions problem on LeetCode. Whether you're preparing for coding interviews or simply looking to enhance your problem-solving skills, this tutorial is designed to help you grasp the concepts and techniques needed to tackle similar challenges with confidence.
In this comprehensive tutorial, we'll walk you through:
⭐ Understanding the problem statement and constraints
⭐ Developing an efficient algorithmic approach
⭐ Writing clean and optimized code
⭐ Analyzing time and space complexities
⭐ Providing detailed explanations for every step
Whether you're a beginner or an experienced coder, this tutorial offers valuable insights and strategies to sharpen your problem-solving skills and ace your coding interviews.
If you found this video helpful, please give it a thumbs up and share it with your friends. Feel free to leave a comment below with any questions or suggestions for future topics.
Thanks for watching, and happy coding! 💻✨
#LeetCode #CodingInterview #Algorithm #ProblemSolving #ProgrammingTutorial #TechInterview #SoftwareEngineering #CodingChallenge #AlgorithmExplained #Python #Java #CPP #ProgrammingCommunity #CodingTips #DataStructures #UA-camTutorial #ComputerScience #SoftwareDevelopment #CodeNewbies #ProgrammingEducation #CSStudents #TechSkills #AlgorithmAnalysis #CodeWithMe #DeveloperLife #ProblemSolvingSkills #CodingJourney #LearnToCode #ProgrammingLanguages #CodeLikeAPro #LeetCodeSolution #InterviewPreparation #SubscribeNow #LikeAndShare #HappyCoding #python #pythonprogramming #python3
Submission: leetcode.com/submissions/detail/1479630843/
🚀 Mastering LeetCode: Maximize Amount After Two Days of Conversions | Road To FAANG
Welcome to Road To FAANG! In this video, we'll dive deep into solving the Maximize Amount After Two Days of Conversions problem on LeetCode. Whether you're preparing for coding interviews or simply looking to enhance your problem-solving skills, this tutorial is designed to help you grasp the concepts and techniques needed to tackle similar challenges with confidence.
In this comprehensive tutorial, we'll walk you through:
⭐ Understanding the problem statement and constraints
⭐ Developing an efficient algorithmic approach
⭐ Writing clean and optimized code
⭐ Analyzing time and space complexities
⭐ Providing detailed explanations for every step
Whether you're a beginner or an experienced coder, this tutorial offers valuable insights and strategies to sharpen your problem-solving skills and ace your coding interviews.
If you found this video helpful, please give it a thumbs up and share it with your friends. Feel free to leave a comment below with any questions or suggestions for future topics.
Thanks for watching, and happy coding! 💻✨
#LeetCode #CodingInterview #Algorithm #ProblemSolving #ProgrammingTutorial #TechInterview #SoftwareEngineering #CodingChallenge #AlgorithmExplained #Python #Java #CPP #ProgrammingCommunity #CodingTips #DataStructures #UA-camTutorial #ComputerScience #SoftwareDevelopment #CodeNewbies #ProgrammingEducation #CSStudents #TechSkills #AlgorithmAnalysis #CodeWithMe #DeveloperLife #ProblemSolvingSkills #CodingJourney #LearnToCode #ProgrammingLanguages #CodeLikeAPro #LeetCodeSolution #InterviewPreparation #SubscribeNow #LikeAndShare #HappyCoding #python #pythonprogramming #python3
Переглядів: 463
Відео
Leetcode 3377 | Digit Operations to Make Two Integers Equal | Biweekly Contest 145
Переглядів 10714 днів тому
Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1474578412/ 🚀 Mastering LeetCode: Digit Operations to Make Two Integers Equal | Road To FAANG Welcome to Road To FAANG! In this video, we'll dive deep into solving the Digit Operations to Make Two Integers Equal problem on LeetCode. Whether you're preparing for coding interviews or simply looking to enhance your pr...
Leetcode 3376 | Minimum Time to Break Locks I | Biweekly Contest 145
Переглядів 14214 днів тому
Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1473719164/ 🚀 Mastering LeetCode: Minimum Time to Break Locks I | Road To FAANG Welcome to Road To FAANG! In this video, we'll dive deep into solving the Minimum Time to Break Locks I problem on LeetCode. Whether you're preparing for coding interviews or simply looking to enhance your problem-solving skills, this t...
Leetcode 3372 | Maximize the Number of Target Nodes After Connecting Trees I | Weekly Contest 426
Переглядів 4921 день тому
Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1467736233/ 🚀 Mastering LeetCode: Maximize the Number of Target Nodes After Connecting Trees I | Road To FAANG Welcome to Road To FAANG! In this video, we'll dive deep into solving the Maximize the Number of Target Nodes After Connecting Trees I problem on LeetCode. Whether you're preparing for coding interviews or...
Leetcode 3371 | Identify the Largest Outlier in an Array | Weekly Contest 426
Переглядів 37021 день тому
Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1467727343/ 🚀 Mastering LeetCode: Identify the Largest Outlier in an Array | Road To FAANG Welcome to Road To FAANG! In this video, we'll dive deep into solving the Identify the Largest Outlier in an Array problem on LeetCode. Whether you're preparing for coding interviews or simply looking to enhance your problem-...
Leetcode 3362 | Zero Array Transformation III | Biweekly Contest 144
Переглядів 458Місяць тому
Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1461780044/ 🚀 Mastering LeetCode: Zero Array Transformation III | Road To FAANG Welcome to Road To FAANG! In this video, we'll dive deep into solving the Zero Array Transformation III problem on LeetCode. Whether you're preparing for coding interviews or simply looking to enhance your problem-solving skills, this t...
Leetcode 3355 | Zero Array Transformation I | Weekly Contest 424
Переглядів 1,1 тис.Місяць тому
Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1456163052/ 🚀 Mastering LeetCode: Zero Array Transformation I | Road To FAANG Welcome to Road To FAANG! In this video, we'll dive deep into solving the Zero Array Transformation I problem on LeetCode. Whether you're preparing for coding interviews or simply looking to enhance your problem-solving skills, this tutor...
Leetcode 3346 | Maximum Frequency of an Element After Performing Operations I | Biweekly Contest 143
Переглядів 729Місяць тому
Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1448935129/ 🚀 Mastering LeetCode: Maximum Frequency of an Element After Performing Operations I | Road To FAANG Welcome to Road To FAANG! In this video, we'll dive deep into solving the Maximum Frequency of an Element After Performing Operations I problem on LeetCode. Whether you're preparing for coding interviews ...
Leetcode 3342 | Find Minimum Time to Reach Last Room II | Weekly Contest 422
Переглядів 60Місяць тому
Part 1: ua-cam.com/video/sUKi5PwiHfk/v-deo.html Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1442071336/ Dijkstra's: ua-cam.com/video/XB4MIexjvY0/v-deo.html 🚀 Mastering LeetCode: Find Minimum Time to Reach Last Room II | Road To FAANG Welcome to Road To FAANG! In this video, we'll dive deep into solving the Find Minimum Time to Reach Last Room I problem on Le...
Leetcode 3341 | Find Minimum Time to Reach Last Room I | Weekly Contest 422
Переглядів 150Місяць тому
Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1442062524/ Dijkstra's: ua-cam.com/video/XB4MIexjvY0/v-deo.html 🚀 Mastering LeetCode: Find Minimum Time to Reach Last Room I | Road To FAANG Welcome to Road To FAANG! In this video, we'll dive deep into solving the Find Minimum Time to Reach Last Room I problem on LeetCode. Whether you're preparing for coding inter...
Leetcode 3332 | Maximum Points Tourist Can Earn | Biweekly Contest 142
Переглядів 137Місяць тому
Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1435526815/ 🚀 Mastering LeetCode: Maximum Points Tourist Can Earn | Road To FAANG Welcome to Road To FAANG! In this video, we'll dive deep into solving the Maximum Points Tourist Can Earn problem on LeetCode. Whether you're preparing for coding interviews or simply looking to enhance your problem-solving skills, th...
Leetcode 3331 | Find Subtree Sizes After Changes | Biweekly Contest 142
Переглядів 232Місяць тому
Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1435540422/ 🚀 Mastering LeetCode: Find Subtree Sizes After Changes | Road To FAANG Welcome to Road To FAANG! In this video, we'll dive deep into solving the Find Subtree Sizes After Changes problem on LeetCode. Whether you're preparing for coding interviews or simply looking to enhance your problem-solving skills, ...
Leetcode 3319 | K-th Largest Perfect Subtree Size in Binary Tree | Weekly Contest 419
Переглядів 782 місяці тому
Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1428678625/ 🚀 Mastering LeetCode: K-th Largest Perfect Subtree Size in Binary Tree Welcome to Road To FAANG! In this video, we'll dive deep into solving the K-th Largest Perfect Subtree Size in Binary Tree problem on LeetCode. Whether you're preparing for coding interviews or simply looking to enhance your problem-...
Leetcode 3320 | Count The Number of Winning Sequences | Weekly Contest 419
Переглядів 532 місяці тому
Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1428663745/ 🚀 Mastering LeetCode: Count The Number of Winning Sequences | Road To FAANG Welcome to Road To FAANG! In this video, we'll dive deep into solving the Count The Number of Winning Sequences problem on LeetCode. Whether you're preparing for coding interviews or simply looking to enhance your problem-solvin...
Leetcode 3316 | Find Maximum Removals From Source String | Biweekly Contest 141
Переглядів 2982 місяці тому
Donate: buymeacoffee.com/roadtofaang Submission: leetcode.com/submissions/detail/1422014867/ 🚀 Mastering LeetCode: Find Maximum Removals From Source String | Road To FAANG Welcome to Road To FAANG! In this video, we'll dive deep into solving the Find Maximum Removals From Source String problem on LeetCode. Whether you're preparing for coding interviews or simply looking to enhance your problem-...
Leetcode 3315 | Construct the Minimum Bitwise Array II | Biweekly Contest 141
Переглядів 1292 місяці тому
Leetcode 3315 | Construct the Minimum Bitwise Array II | Biweekly Contest 141
Leetcode 3310 | Remove Methods From Project | Weekly Contest 418
Переглядів 692 місяці тому
Leetcode 3310 | Remove Methods From Project | Weekly Contest 418
Leetcode 3309 | Maximum Possible Number by Binary Concatenation | Weekly Contest 418
Переглядів 582 місяці тому
Leetcode 3309 | Maximum Possible Number by Binary Concatenation | Weekly Contest 418
Leetcode 3301 | Maximize the Total Height of Unique Towers | Biweekly Contest 140
Переглядів 992 місяці тому
Leetcode 3301 | Maximize the Total Height of Unique Towers | Biweekly Contest 140
Leetcode 3296 | Minimum Number of Seconds to Make Mountain Height Zero | Weekly Contest 416
Переглядів 1232 місяці тому
Leetcode 3296 | Minimum Number of Seconds to Make Mountain Height Zero | Weekly Contest 416
Leetcode 3298 | Count Substrings That Can Be Rearranged to Contain a String II | Weekly Contest 416
Переглядів 973 місяці тому
Leetcode 3298 | Count Substrings That Can Be Rearranged to Contain a String II | Weekly Contest 416
Leetcode 3286 | Find a Safe Walk Through a Grid | Biweekly Contest 139
Переглядів 1413 місяці тому
Leetcode 3286 | Find a Safe Walk Through a Grid | Biweekly Contest 139
Leetcode 3290 | Maximum Multiplication Score | Weekly Contest 415
Переглядів 773 місяці тому
Leetcode 3290 | Maximum Multiplication Score | Weekly Contest 415
Leetcode 322 | Coin Change | Tabulation Solution
Переглядів 533 місяці тому
Leetcode 322 | Coin Change | Tabulation Solution
Leetcode 3276 | Select Cells in Grid With Maximum Score | Weekly Contest 413
Переглядів 1593 місяці тому
Leetcode 3276 | Select Cells in Grid With Maximum Score | Weekly Contest 413
Leetcode Biweekly Contest 138 Screencast | Another Tough One!
Переглядів 303 місяці тому
Leetcode Biweekly Contest 138 Screencast | Another Tough One!
Leetcode 3273 | Minimum Amount of Damage Dealt to Bob | Biweekly Contest 138
Переглядів 1133 місяці тому
Leetcode 3273 | Minimum Amount of Damage Dealt to Bob | Biweekly Contest 138
Leetcode 322 | Coin Change | Memoization Solution
Переглядів 503 місяці тому
Leetcode 322 | Coin Change | Memoization Solution
Leetcode 3265 | Count Almost Equal Pairs 1 | Weekly Contest 412
Переглядів 783 місяці тому
Leetcode 3265 | Count Almost Equal Pairs 1 | Weekly Contest 412
I use several resources for interview prep, and your videos are the best so far. Neetcode is great, but i found your explanation very concise. Thanks!
Thank you so much! To be compared to Neetcode is a huge honor
nice one,suggestion try to explain what question is saying in detail then how we going to data structure
Thanks for the suggestion. I will definitely keep that in mind!
Try using a for loop, I feel that it is easy, I asked chatgpt lol 😂
Great keep going we are with you
Thank you for the comment!
how do you guys come up with such a solution ?
Just keep practicing! It will be hard at first but once you have seen a lot of similar problems you will start to see patterns like this
@@RoadToFAANG1992 how much time does it take or how many questions to come at that stage ?
nice explanation
Thanks! I’m glad it was helpful
why not just add 1 to mark the start of the interval and -1 to indicate the end? appreciate the help 👍
Do you mean as opposed to doing -1 after the end of the interval? We do it that way because it allows capture the entire interval. Say for example we had the interval 0,2. If we placed the -1 at 2 then our prefix sum would look like [1,1,0,0]. You’ll see that doesn’t cover the full range of 0 to 2. If we instead put the -1 after the end of the interval we get the prefix sum [1,1,1,0] which does represent the full range of 0 to 2. I hope this answers the question!
@@RoadToFAANG1992 thanks for the clarification! I meant more in terms of why we do +=1 and -=1 when indicating the start and end of the interval while iterating through the queries.
Thanks for this solution. But this solution will get "Time Limit Exceeded" for bigger testcases.
Hey thanks for the comment! I just tested this solution again and it does pass all the test cases. Do you mean for test cases larger than the given constraints?
more ppl should subscribe bro this is high quality shit
Thank you I’m glad you like the videos!
Nice Explanation , However I am still confused how do you handle such cases [88,53] k = 27 numOperations = 2 , this test case focusses on having 2 numbers not reachable through k directly, however could reach each one another through middle num for example here 66 where 88-22 and 53+13 ,as one could not be reached to other directly by applying +/- 27
Yea the logic still works for cases like that. The reason is that we are not testing only those numbers, but also all the numbers in between. We will eventually get to 66 and test what numbers we can change to get to 66.
@@RoadToFAANG1992 Got it ..Thanks !!
Great and simple solution.
Glad you like it!
Hi, there! Thank you for the explanation, but in the first example nums = [1, 0, 0] and queries = [[0,2]] it's not clear for me why we're not modifying the number zero. Could you please explain this? Thanks a lot!
Because at the end, we are looking for our array to be all 0's example - [0,0,0,0] at the end. If you decrement more than 0, you'll get a negative number. So subtracting further after seeing a 0 will ruin the array.
What @dThapa966 said is correct. We want to make all the elements equal 0. For each query, we only need to choose a subset of elements in the range. This means that we can choose not to decrement any elements which are already 0
your explanation is best and easy to understand that i can find , please do it regularly for every contest(only 2nd and 3rd question🙂)
Thank you! I’m glad it was helpful and will continue to do as many contests as I can
isnt finding the length of the keys a 0(N) operation, so the total time complexity is O(Q*N)? shouldnt u have a counter to does it instead??
Thanks for the solution! It's really clever
Thank you! I’m glad it was helpful
It was helpful, Thanks
No problem! I’m glad it was helpful
Thanks a lot for resources and guidance too bruh
Absolutely! I’m glad you found it helpful
so underrated channel.. the explanation is top notch
Thank you! I really appreciate it
nice explanation
Thanks! I’m glad it was helpful!
amazing solution. which category would this problem fall under? math?
Thank you! Yea I think this would be considered to be a math/geometry problem.
Great stuff. Failed an interview recently I wasn’t ready. Back to the books.
It happens to all of us. The only way we can truly fail is if we stop trying so take a small break and get back to the grind
A great and smooth explanation❤ Thanks
Glad it helped!
Quick question how accurate are the scores attached to contest questions when gauging difficulty? they range from 1-11 but usually questions asked in contests have a rating of between 3-7
I think they are a pretty good indicator of the general difficulty but they are not exact. For example, if I see an 8 I’m pretty sure it’s going to be a very hard problem. On the other hand a 5 I sometimes find pretty easy or quite hard. It’s a good general guide but not exact.
@@RoadToFAANG1992 I see got it. Thank you.
@@RoadToFAANG1992 okay thank you so much. Btw how accurate is zerotrac? If I did say all 1200-1300, 1300-1400 level problems and understood them, could I expect to be able to do qn 1 consistently in contests. My target right now is to be able to do Qn 1 and 2 consistently. Seems for Qn 1 you need to be good with 1100-1400 level problems and for Qn 2 you need to be good with 1400-1800 level problems
I would say it depends on the contest. Recently the contests have become extremely hard to try and stop people from cheating using ChatGPT. If you can get to 1800 I would say for most contests you would be able to solve 3 questions but maybe only 2 in more recent contests. Q1 is usually very easy so as long as you are confident in your DSA I think Q1 should be fine. However in some recent contests Q1 have been medium even though they are a bit on the easier side
@@RoadToFAANG1992 I see!! Damn they are making them more difficult. Thanks for the feedback. I’m trying to do all weekly between 1200-1400 since my rating is at 1250 despite doing 900 LC. Basically starting over. My target is to hit 1700 or at most 1800 by next year
great video. Thanks for introducing zerotrac to me
Of course! It’s a great resource hopefully it’s helpful for you
Congratulations, great video and honest video. Thank you
Thank you! I’m glad this video was helpful for you
BEST explanation that i found for this question. Thank you! It was a nightmare just to understand it.
Perfect! I’m glad I can help
Thank you for content, I always use it to reflect & learn post contest.
Glad the content is helpful for you! I will keep creating it but also let me know what types of content would help you more!
Wonderful video. Investing in at 81 subs. You deserve more. Keep goin brotha!
Thanks! Glad you’re liking the content!
Nicely done
Thanks!
finally an explanation that i can easily understand, well put together, precise. Thank you
Glad it was helpful!
this was pretty good mate, cheers
Glad you enjoyed it!
Great videos! Your explanation is short and concise. Please don't stop making such amazing videos.
Glad you like them!
I wasted an hour because I couldn't understand the question in the contest.
The description was definitely unclear. Leetcode really needs to to better with these contests
Great job breaking the problem down and coherently explaining your logic step by step.
Glad it was helpful!
Thanks this solution is understandable. I will need more practice to come up with it in contest itself.
Me too. I was not able to get it in the contest. We just need to keep grinding and we will get there
Hey how did you manage to pass the last testcase, I am getting TLE with your same code, i got it from your profile on leetcode so its same. It fails on last test case.
That’s weird. Let me try to run it again. Maybe they tightened the constraints since after the contest
@@RoadToFAANG1992 let me know did it pass for you or not
The original solution is getting a TLE but if on line 18 you change it to `for count, x in pairs[:100]:` it will work. In this case we only go through the first 100 possible x values
It would be better if you could give a link to your code, try to have your leetcode screen at 150% or more as its hard to read from small characters. Everything else is fine
That’s a great idea. Will definitely do that in future videos
Good way of explaining
Thanks! I’m glad it was helpful
I sub y thanks for such a great content
Thanks you for subscribing! I’m glad you are enjoying the content
This is a good explanation. Thank you for that but instead of using an indices array, you could use a dictionary for constant look-up. something like this: occurrences = {} for i in range(len(nums)): if nums[i] == x: if x in occurrences: occurrences[x].append(i) else: occurrences[x] = [i]
Thanks for the comment! Yes we could definitely do it this way with a hashmap as well. Using the array should still be a constant look up however, since we are just getting a specific index in the array and not traversing through the whole thing each time.
Great! Best solution, thanks!!
Glad it was helpful!
thanks man, nice
No problem!
Road To FAANG, You're amazing! Let's be friends and hang out!
Glad you’re enjoying the content!