Text Justification - Leetcode 68 - Python

  Рет қаралды 29,087

NeetCodeIO

NeetCodeIO

Күн бұрын

Пікірлер: 43
@flueesyblueesy6246
@flueesyblueesy6246 Жыл бұрын
This question has been the bane of me for years now
@johnj171
@johnj171 5 ай бұрын
😂😂😂😂its nice to know someone out there
@Syed_Shifat
@Syed_Shifat Жыл бұрын
Hey Neet, I love you, man. I wish I could meet you someday. Your videos are greatly organized and so helpful.
@akashchandra4uify
@akashchandra4uify Жыл бұрын
Me too.
@CST1992
@CST1992 7 ай бұрын
I got this one in a CodeSignal assessment. Solving this PLUS 3 other (smaller) questions in a 70-minute time frame? Forget it.
@vigneshs1852
@vigneshs1852 5 ай бұрын
shitt.......😬😬
@Chinmay_395
@Chinmay_395 7 күн бұрын
was it for capital one?
@RagingAcid
@RagingAcid Жыл бұрын
I've been waiting for this one from you
@garth2356
@garth2356 Жыл бұрын
They legit asked this exact same question in the coding round for DevRev and I was able to solve it!
@CarsMeetsBikes
@CarsMeetsBikes 11 ай бұрын
wish I saw this video before I got a problem in a coding round today. Couldn't figure out the justification part, but at least separated the words correctly
@manasawalaaamir
@manasawalaaamir 2 ай бұрын
this is really good, your coding style is very easy to understand !
@VidyaBhandary
@VidyaBhandary Жыл бұрын
Finally!!! Thank you. Needed this one.
@MP-ny3ep
@MP-ny3ep Жыл бұрын
Thank you so much for the daily problems
@hbhavsi
@hbhavsi Ай бұрын
I solved this but mine is quite long and handles cases separately. This is very neat. On the lines of some top solutions on the Leetcode page, but those solutions are super hard to understand.
@impatientgaming9868
@impatientgaming9868 7 ай бұрын
Had to rewatch once but good explanation.
@ruthlessogre2441
@ruthlessogre2441 Жыл бұрын
This was one of the easiest hard questions.
@Benstokes555
@Benstokes555 6 ай бұрын
yes but the edge cases are pretty confusing. therre isnt much logic to be applied in this.
@aadil4236
@aadil4236 Жыл бұрын
The Problem was good. It imporves your thinking. Can you share more problem like these? Thanks for the explanation!
@NeetCodeIO
@NeetCodeIO Жыл бұрын
Yeah I really enjoyed it. I don't remember many like this tbh, but if anyone else does feel free to mention them here.
@isaiahr7041
@isaiahr7041 Жыл бұрын
When you say "It improves your thinking", does this specific problem benefit you in coming up with more efficient and elegant approaches, especially with to string related problems? Even though many LC problems can enhance your problem-solving skills, does this specific one opens up to newer techniques you could use based upon what you have said?
@ManishKumar-zt5sk
@ManishKumar-zt5sk 2 ай бұрын
saw your video and wrote the code in C++, ACC in 1st attempt
@shawnzhang528
@shawnzhang528 Жыл бұрын
So elegant answer
@vinleous
@vinleous Жыл бұрын
Thanks for uploading the dailies again!
@uptwist2260
@uptwist2260 Жыл бұрын
Thanks for the daily
@theja63
@theja63 Ай бұрын
This in itself is a microservice for sure.
@akhma102
@akhma102 2 ай бұрын
Thanks Neet!
@kidscodera3043
@kidscodera3043 9 ай бұрын
very useful video ,thanks for amazing explaination . Can you please tell me where is this mention that there has to be space between 2 consecutive words in the line. Like in example 3 : line#3 has the word enough which can be fir easily in the line#2 if we don't keep space in between two words.Please tell me if I have misinterpreted the question ,because I can not find any such restriction in question where it says that there has to be a space in between consecutive words.On the other hand , it clearly mentions that " each line has exactly maxWidth characters ", see question is only talking about characters , no constraints given about compulsary word prefix/suffix . Please help
@mortal_coder4869
@mortal_coder4869 Жыл бұрын
Great Coding there, thank you!
@ThefactMaster01
@ThefactMaster01 Жыл бұрын
Amazing explanation.
@jard8994
@jard8994 3 ай бұрын
thanks for the video
@SrinivasNarayanamrocks
@SrinivasNarayanamrocks 6 ай бұрын
you missed a case to handle the single word sentences which is not the last sentence: if len(line) == 1: line[0] += ' ' * extra_space this line would come in around line 13 of your code
@Benstokes555
@Benstokes555 6 ай бұрын
saaari duniya see jeeth ke me aaya hu idhar🤓🤓
@chirpy7961
@chirpy7961 Жыл бұрын
Is the space complexity of this is o(n) where n is the number of words for each line....? please correct me if I'm wrong....
@ax5344
@ax5344 8 ай бұрын
I tried to find python solution of this problem from your website, but it is not there. Could you verify?
@kingfriizy5707
@kingfriizy5707 2 ай бұрын
im bouta crash out
@anuragchoudhury365
@anuragchoudhury365 Жыл бұрын
I have a question at line #27. In case the line contains one word with exactly the same number of characters as maxWidth, won't the last line contain maxWidth + 1 characters? Why is it not giving an error for exceeding the maxWidth. I'm not familiar with Python so if you/someone can help me understand this.
@ArgonautJasonLoL
@ArgonautJasonLoL Жыл бұрын
It won't because #27 is the delimiter is what is put between words in this case. If there is only one word, then no delimiters are added.
@AlexErmashev
@AlexErmashev 9 ай бұрын
How long did it take you to solve it?
@ryanrenjith3504
@ryanrenjith3504 5 ай бұрын
took me 1.5 hrs grinding it with a pen and paper
@dheerajgowda9208
@dheerajgowda9208 12 күн бұрын
It’s starting to make me feel a bit dumb when everyone keeps saying it’s easy.
@divyam1175
@divyam1175 Ай бұрын
i copied the exact solution and still it shows error
@metarus208
@metarus208 Жыл бұрын
need mmmmmooorre
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 150 М.
SIZE DOESN’T MATTER @benjaminjiujitsu
00:46
Natan por Aí
Рет қаралды 3,1 МЛН
The Ultimate Sausage Prank! Watch Their Reactions 😂🌭 #Unexpected
00:17
La La Life Shorts
Рет қаралды 8 МЛН
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 60 МЛН
Text Justification Algorithm (LeetCode)
30:45
AlgosWithMichael
Рет қаралды 32 М.
Worst leetcode hard problem - Text Justification : 68
13:06
Destination FAANG
Рет қаралды 2,8 М.
Game of Life - Leetcode 289 - Python
17:36
NeetCode
Рет қаралды 43 М.
Gas Station - Greedy - Leetcode 134 - Python
15:47
NeetCode
Рет қаралды 142 М.
Candy - Leetcode 135 - Python
13:45
NeetCodeIO
Рет қаралды 33 М.
Gitlab DELETING Production Databases | Prime Reacts
17:27
ThePrimeTime
Рет қаралды 350 М.
Text Justification Dynamic Programming
15:31
Tushar Roy - Coding Made Simple
Рет қаралды 143 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 835 М.
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 303 М.
This Algorithm is 1,606,240% FASTER
13:31
ThePrimeagen
Рет қаралды 853 М.
SIZE DOESN’T MATTER @benjaminjiujitsu
00:46
Natan por Aí
Рет қаралды 3,1 МЛН