Increasing Triplet Subsequence | Leetcode 334 | Live coding session | Leetcode December Day 18

preview_player
Показать описание
1) 0:00 Explaining the problem out loud
2) 1:07 Algorithm walkthrough
3) 2:15 Coding it up
4) 6:00 Time complexity

TC :O(n)
SC :O(1) For storing 2 variable
where n is the no of elements in input array

Рекомендации по теме
Комментарии
Автор

Soo beautiful, soo elegant, just looking like a woow 🔥

devanshsrivastava
Автор

Man, your solution is so simple and it feels like a slap on my face 😞 Was trying to use longest increasing subsequence for this silly problem.

tanson
Автор

It's a very great and simple perspective of solving this problem, thanks for sharing.

TH-lnzf
Автор

this won't work if ele<left ans that ele is not part of sequece;

vishwassahu
Автор

how is the code working on [20, 100, 10, 12, 5, 13]

GeniuslyTensai
Автор

for array: 57, 21, 29, 17, 57, 47, 4, 79, 78
has increasing triplet subsequence...but this code will say look into it....getting this error from doing geeks for geeks sorted subsequence of size 3 question

rusancodingtech