Minimum String Length After Removing Substrings - Leetcode 2696 - Python

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

NeetCodeIO

NeetCodeIO

Күн бұрын

Пікірлер: 19
@ArminEghdamiDrums
@ArminEghdamiDrums 2 ай бұрын
I love that NeetCode has gotten all the milk he needs now and he does the daily vids again.
@nikhil199029
@nikhil199029 2 ай бұрын
its has become cheese now
@deadlyecho
@deadlyecho 2 ай бұрын
I figured the stack solution but the other solution is messy...
@shepmax555
@shepmax555 2 ай бұрын
Thanks for posting LeetCode daily problems. It's really helpful
@jaydeeppatel2176
@jaydeeppatel2176 2 ай бұрын
Strings are immutable in python so the second solution is only good for c++
@prajwals8203
@prajwals8203 2 ай бұрын
Thanks for the vid.....It helped to understand that inplace solution and editorial did fantastic job of explaining the in place solution🙂🙂....
@AlfredPros
@AlfredPros 2 ай бұрын
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.
@muskaanfathima8183
@muskaanfathima8183 2 ай бұрын
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
@birdbeakbeardneck3617
@birdbeakbeardneck3617 2 ай бұрын
whats a general solution for a set of strings, and the removable syrings cant be substrings or share paets with each other?
@SidhanthSanil
@SidhanthSanil 2 ай бұрын
Consistent 😛
@anandsahoo3711
@anandsahoo3711 2 ай бұрын
i did it recursively class Solution { public int minLength(String s) { return solve(s); } public int solve(String s){ for(int i=0; i
@chien-yuyeh9386
@chien-yuyeh9386 2 ай бұрын
Thanks for sharing! 🎉
@robertbaindourov134
@robertbaindourov134 2 ай бұрын
Yeah, great job. Thank you.
@sirojiddinSoftwareEngineer
@sirojiddinSoftwareEngineer 2 ай бұрын
Great job
@khalidhussien6764
@khalidhussien6764 2 ай бұрын
Please do "1497. Check If Array Pairs Are Divisible by k".
@vivekbaranwal
@vivekbaranwal 2 ай бұрын
he already has put a solution for this problem
@Lohan_Guedes
@Lohan_Guedes 2 ай бұрын
Nice man, but pls launch the SQL courses plssss
Circular Sentence - Leetcode 2490 - Python
7:12
NeetCodeIO
Рет қаралды 4,8 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 715 М.
Do you love Blackpink?🖤🩷
00:23
Karina
Рет қаралды 25 МЛН
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 41 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 10 МЛН
Maximum Number of Points with Cost - Leetcode 1937 - Python
15:15
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 165 М.
Microservices Gone Wrong at DoorDash
17:22
NeetCodeIO
Рет қаралды 164 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 334 М.
Coding Interviews Be Like
5:31
Nicholas T.
Рет қаралды 6 МЛН
Minimum Time Difference - Leetcode 539 - Python
21:43
NeetCodeIO
Рет қаралды 9 М.
All Rust string types explained
22:13
Let's Get Rusty
Рет қаралды 186 М.
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 618 М.
Subarray Product Less Than K - Leetcode 713 - Python
10:26
NeetCodeIO
Рет қаралды 17 М.
Do you love Blackpink?🖤🩷
00:23
Karina
Рет қаралды 25 МЛН