Increasing Triplet Subsequence || Leetcode JAVA || O(N)
Vložit
- čas přidán 5. 09. 2024
- Hi folks!
Here we are solving 334. Increasing Triplet Subsequence || Leetcode C++ || O(N) time complexity || O(1) Space complexity
Easy explanation in Hindi.
Problem link : leetcode.com/p...
If you have any queries reach out to me at
linktr.ee/udya...
Wow what an explanation bro! 🤩🤩🤩 God bless you 🥰🥰🥰
wow super bro thanks ❤️
Thank you too
Darun akta video dadavai
Tomake aneka dhanyabada
Amar poribarer aso
@@purna949 🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣
great
Thanks
Thik Hai.....
Thik Hai 👍
I just found that It's similar to partion sort (card game)
Wow!!!
Dammmmmmmmmmm❤❤❤❤❤
Lessgoo 🔥
samjhane ka tarika kaafi badhiya
keep it up bro
Thank you so much bro.
why did you check for
According to question, We want to return true only if nums[i] < nums[j] < nums[k]
and by using
Dry run for 1 2 1 2 1 2 3 case
😎😎
// Python3 :
class Solution:
def increasingTriplet(self, nums: List[int]) -> bool:
left, mid = sys.maxsize, sys.maxsize
for num in nums:
if num
// C++ :
class Solution {
public:
bool increasingTriplet(vector& nums) {
int N = nums.size();
int left = INT_MAX;
int mid = INT_MAX;
for(int num : nums) {
// num = nums[i];
if(num
// JAVA :
class Solution {
public boolean increasingTriplet(int[] nums) {
int N = nums.length;
int left = Integer.MAX_VALUE;
int mid = Integer.MAX_VALUE;
for(int num : nums) {
// num = nums[i];
if(num