Minimum String Length After Removing Substrings - Leetcode 2696 - Python

  Рет қаралды 5,888

NeetCodeIO

NeetCodeIO

Күн бұрын

Пікірлер: 19
@ArminEghdamiDrums
@ArminEghdamiDrums Ай бұрын
I love that NeetCode has gotten all the milk he needs now and he does the daily vids again.
@nikhil199029
@nikhil199029 Ай бұрын
its has become cheese now
@deadlyecho
@deadlyecho Ай бұрын
I figured the stack solution but the other solution is messy...
@shepmax555
@shepmax555 Ай бұрын
Thanks for posting LeetCode daily problems. It's really helpful
@jaydeeppatel2176
@jaydeeppatel2176 Ай бұрын
Strings are immutable in python so the second solution is only good for c++
@prajwals8203
@prajwals8203 Ай бұрын
Thanks for the vid.....It helped to understand that inplace solution and editorial did fantastic job of explaining the in place solution🙂🙂....
@muskaanfathima8183
@muskaanfathima8183 Ай бұрын
im trying to stay consitent but everyday I come and find neetcode for solutions...I'm I on the right track :(
@aIgojoe
@aIgojoe Ай бұрын
Trust it gets easier over time. If the problem seems too hard or complicated, chances are that you haven’t found the right Data Structure (Stack in this case) or algorithm to solve it easily.
@muskaanfathima8183
@muskaanfathima8183 Ай бұрын
@@aIgojoe yes hope I'll get better
@anandsahoo3711
@anandsahoo3711 Ай бұрын
i did it recursively class Solution { public int minLength(String s) { return solve(s); } public int solve(String s){ for(int i=0; i
@AlfredPros
@AlfredPros Ай бұрын
The slow, but short code to solve this problem is using regex replace. def minLength(self, s: str) -> int: while True: slen = len(s) s = re.sub("(AB|CD)", "", s) if slen == len(s): return slen The loop breaks when there's no more AB or CD to replace. In this case, regex ran slower than string replace.
@robertbaindourov134
@robertbaindourov134 Ай бұрын
Yeah, great job. Thank you.
@chien-yuyeh9386
@chien-yuyeh9386 Ай бұрын
Thanks for sharing! 🎉
@sirojiddinSoftwareEngineer
@sirojiddinSoftwareEngineer Ай бұрын
Great job
@birdbeakbeardneck3617
@birdbeakbeardneck3617 Ай бұрын
whats a general solution for a set of strings, and the removable syrings cant be substrings or share paets with each other?
@SidhanthSanil
@SidhanthSanil Ай бұрын
Consistent 😛
@khalidhussien6764
@khalidhussien6764 Ай бұрын
Please do "1497. Check If Array Pairs Are Divisible by k".
@vivekbaranwal
@vivekbaranwal Ай бұрын
he already has put a solution for this problem
@Lohan_Guedes
@Lohan_Guedes Ай бұрын
Nice man, but pls launch the SQL courses plssss
Circular Sentence - Leetcode 2490 - Python
7:12
NeetCodeIO
Рет қаралды 4,8 М.
Sentence Similarity III - Leetcode 1813 - Python
15:07
NeetCodeIO
Рет қаралды 10 М.
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 8 МЛН
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 9 МЛН
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 22 МЛН
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 150 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 695 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 330 М.
10 weird algorithms
9:06
Fireship
Рет қаралды 1,3 МЛН
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 253 М.
Coding Interviews Be Like
5:31
Nicholas T.
Рет қаралды 6 МЛН
All Rust string types explained
22:13
Let's Get Rusty
Рет қаралды 184 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 286 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 199 М.
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 8 МЛН