Increasing Triplet Subsequence | Leetcode
HTML-код
- Опубликовано: 12 сен 2024
- This video explains the increasing triplet subsequence problem using multiple easy-to-understand and optimal approaches.
----------------------------------------------------------------------------------------------------------------------------------------------------------------
🟣 JOIN our 𝐋𝐈𝐕𝐄 𝐢𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐭𝐫𝐚𝐢𝐧𝐢𝐧𝐠 𝐩𝐫𝐨𝐠𝐫𝐚𝐦 through whatsapp query: +91 8918633037
🟣 𝐂𝐡𝐞𝐜𝐤𝐨𝐮𝐭 𝐚𝐥𝐥 𝐨𝐮𝐫 𝐂𝐨𝐮𝐫𝐬𝐞𝐬: techdose.co.in/
🔵 LinkedIn: / surya-pratap-kahar
🔴 INSTAGRAM: / techdose_official
🟢 𝐓𝐞𝐜𝐡𝐝𝐨𝐬𝐞-𝟏𝟎𝟎 𝐬𝐡𝐞𝐞𝐭: docs.google.co...
---------------------------------------------------------------------------------------------------------------------------------------------------------------
𝐋𝐈𝐒 𝐢𝐧 𝐍𝐥𝐨𝐠𝐍: • Longest Increasing Sub...
𝐋𝐈𝐒 𝐰𝐢𝐭𝐡 𝐃𝐏: • Longest increasing sub...
𝐂𝐎𝐃𝐄 𝐋𝐈𝐍𝐊: gist.github.co...
The algorithm is wrong at 13:24 for [5,3,0,3,1,-1,2]. It fails the condition where i < j < k.
When you update variable named as first in code using if condition with -1(from nums[5] in list which is j) , the variable named second holds value 1 (from nums[4] in list which is i). Therefore fails the condition i
True
dry-run was exemplary. thank you
Welcome :)
nice explanation. no others could have explained to me like this. thanks!
Best 👌
Very good explanation 👏 keep it up
love the explanation!
your explanations are super cool
Thanks :)
We can just use a stack and maintain increasing sequence in it. You explanation also follows the same logic but is difficult to understand in comparison to stack. Let me know if my proposal is incorrect and miss any test cases
Yes you can solve using stack too :)