Leetcode 128 Longest Consecutive Sequence - Python Solution

  Рет қаралды 378

Data Engineering Studies

Data Engineering Studies

Күн бұрын

Пікірлер: 4
@mrunknown69692
@mrunknown69692 9 ай бұрын
bhai thanks for the python solution. there are not much resources available for dsa with python. keep going
@dataenggstudies
@dataenggstudies 9 ай бұрын
Sure, I will upload more. Glad it helped.
@lutherlusk2975
@lutherlusk2975 9 ай бұрын
youre writing while inside for , doesnt that incrase the time complexity from n to m * n or something like that ?
@dataenggstudies
@dataenggstudies 9 ай бұрын
This solution looks like O(n*m) but it is actually not because we are iterating over the while loop only for the numbers that are 'first' numbers, in other words the numbers that satisfy the condition (if n-1 not in nums:) not for all the numbers. Hence the time complexity is O(n).
Leetcode 198 House Robber - Python solution
8:00
Data Engineering Studies
Рет қаралды 103
Симбу закрыли дома?! 🔒 #симба #симбочка #арти
00:41
Симбочка Пимпочка
Рет қаралды 4,4 МЛН
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 51 МЛН
Leetcode 128 - LONGEST CONSECUTIVE SEQUENCE
9:24
NeetCode
Рет қаралды 390 М.
Merge Intervals - Placement Essentials - Leetcode 56 - tamil
15:39
Algo Tamizha
Рет қаралды 2,7 М.
Sum of Subarray Minimums - Leetcode 907 - Python
18:51
NeetCodeIO
Рет қаралды 35 М.
Longest Consecutive Sequence | Leetcode 128 | Hashset
12:38
Ayushi Sharma
Рет қаралды 12 М.
Longest Consecutive Sequence | leetcode 128 | Hindi
12:07
Codebix
Рет қаралды 9 М.
Longest Consecutive Sequence Leetcode in Telugu  | DSA in Python
16:11
Симбу закрыли дома?! 🔒 #симба #симбочка #арти
00:41
Симбочка Пимпочка
Рет қаралды 4,4 МЛН