Leetcode 1957: Delete Characters to Make Fancy String

  Рет қаралды 243

Algorithms Casts

Algorithms Casts

Күн бұрын

Пікірлер: 4
@galaxybeat4057
@galaxybeat4057 16 күн бұрын
Good Video but the solution is actually O(n ^ 2) time complexity because appending to a string is an O(n) time operation. Consider using a list for res because appending to a list is an O(1) time complexity task. And in the end just return "".join(res)
@MFAWZHAAROONAIML
@MFAWZHAAROONAIML 23 күн бұрын
class Solution: def makeFancyString(self, s: str) -> str: result = [] for char in s: if len(result) < 2 or not (result[-1] == char and result[-2] == char): result.append(char) return ''.join(result)
Leetcode 796. Rotate String
4:26
Algorithms Casts
Рет қаралды 151
Leetcode 3163: String Compression III
12:43
Algorithms Casts
Рет қаралды 86
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 96 МЛН
Noodles Eating Challenge, So Magical! So Much Fun#Funnyfamily #Partygames #Funny
00:33
Leetcode 3341: Find Minimum Time to Reach Last Room I
11:09
Algorithms Casts
Рет қаралды 193
Let's code a beginner Python BANKING PROGRAM 💰
15:01
Bro Code
Рет қаралды 263 М.
Valid Palindrome - Leetcode 125 - Python
14:58
NeetCode
Рет қаралды 278 М.
Coding Was HARD Until I Learned These 7 Things...
7:46
Web Developete
Рет қаралды 771
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 246 М.
How to win a argument
9:28
ajaxkmr (ajaxkmr1986)
Рет қаралды 705 М.
Circular Sentence | Leetcode 2490
8:25
Techdose
Рет қаралды 1,3 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 329 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 688 М.