LeetCode 763. Partition Labels (Solution Explained)
Vložit
- čas přidán 20. 09. 2019
- The Best Place To Learn Anything Coding Related - bit.ly/3MFZLIZ
Join my free exclusive community built to empower programmers! - www.skool.com/software-develo...
Preparing For Your Coding Interviews? Use These Resources
--------------------
(My Course) Data Structures & Algorithms for Coding Interviews - thedailybyte.dev/courses/nick
AlgoCademy - algocademy.com/?referral=nick...
Daily Coding Interview Questions - bit.ly/3xw1Sqz
10% Off Of The Best Web Hosting! - hostinger.com/nickwhite
Follow My Twitter - / nicholaswwhite
Follow My Instagram - / nickwwhite
Other Social Media
----------------------------------------------
Discord - / discord
Twitch - / nickwhitettv
TikTok - / nickwhitetiktok
LinkedIn - / nicholas-w-white
Show Support
------------------------------------------------------------------------------
Patreon - / nick_white
PayPal - paypal.me/nickwwhite?locale.x...
Become A Member - / @nickwhite
#coding #programming #softwareengineering - Věda a technologie
Has someone ever told you how easy you make it to understand complicated problems and solutions? It's all because of you that I have started solving leetcode problems on my own and going to interview with TikTok very soon for a SDE role. Thanks for putting up all these videos online :)
hey gentleman how your interview gone?
Plsss doooo hackerrank,codechef and alsoo continue doingg this leetcode...anyway ur explanation is awesome
Excellent explanation! Thank you.
nick coming thru with the solutions 💯
old I know, but you explained perfectly, the "in at most part" made no sense reading it, you saying it was a head slap moment
Loved the explanation. This is coding question from Amazon :)
Thank you very much for your excellent explanation!
great explanation! Thank you Nick!
Thanks! It is more clear than explanation on Leetcode's Solution section
Your Explanations are awesome such a life saver
Thank you so much for the wonderful explanation :)
shout out for explaining it so well.
Great Explanation! Thank you!
very good explanation...a question Nick ! I have a Google screening round, a telephonic one. LeetCode questions are enough for practice ? Can you please tell me what should be the good material to clear that round? Thanks in advance.
Great video. Thanks a lot 😊👍
thanks this really helped!
Excellent approach..I wish you could be a professor at my college 🙌🙌🙌🙌
Thank You Nick
Wow! Great solution
excellent solution
Thanks, Nice explanation :)
Really nice video.
This question statement is very confusing.
Your explanation make it easy to understand
Cool explaination
You are awesome 👏🏽
absolutely helpful :)
S will have length in range [1, 500] then why base condition?
You are awesome..
clear explanation
good explanation ! Happy2021
nice job!!!!
You are fabulous. Just want to know how do u approach such non trivial problem/solution ?
good explanation, but i think in line 14, i should equal to start , right?
The answer in my case is wrong by changing the like 17 BY
arr.push_back(end+1-start);
gives a fine answer
How is it constance space? Isn't last_indices an array which is O(n) space?
We can do it without the extra space of int[]
I always like your video first before watching it
For loop should be int i = start instead of 0 .
class Solution(object):
def compressAndGetRanges(self, rangeDict):
# Compress overlapping ranges in the given rangeDict and return the compressed ranges
cRanges = [] # Stack to store compressed ranges
for key, value in rangeDict.items():
print(key, value)
# Check if the stack is not empty and if the current range intersects with the last range in the stack
if len(cRanges) != 0 and self.isIntersection(value, cRanges[-1]):
# Merge the intersecting ranges and push the merged range onto the stack
cRanges.append(self.mergeRange(cRanges.pop(), value))
else:
# Push the current range onto the stack
cRanges.append(value)
return cRanges
def isIntersection(self, range1, range2):
# Check if two ranges intersect
return (range2[0] >= range1[0] and range2[0] = range2[0] and range1[0]
"Wouldn't be one of my videos if I don't mess up!!"
Because he is a human
awesome
got it after seeing it in 2nd time
❤️❤️
reprisigning
Respect++
wow 🤩🤩🤩🤩🤩🤩🤩
Can people actually come with these solutions in a real interview without seeing this problem before lol?
Why your channel don't show how many subscribers you have?
MY CODE, ON MY OWN. kinda shitty
class Solution {
public:
vector partitionLabels(string s) {
vector res;
int n=s.size();
unordered_map mpp;
for(int i=0;i