3105. Longest Strictly Increasing or Strictly Decreasing Subarray | Array | Sliding Window

  Рет қаралды 1,196

Aryan Mittal

Aryan Mittal

4 ай бұрын

In this video, I'll talk about how to solve Leetcode 3105. Longest Strictly Increasing or Strictly Decreasing Subarray | Array | Sliding Window
Let's Connect:
📝Linkedin: / aryan-mittal-0077
📸 Instagram: / ez.pz.dsa
📱Telegram : t.me/aryan_mittal_group
🤖 Github: github.com/aryan-0077
About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
✨ Timelines✨
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Пікірлер: 10
@learningmaths786
@learningmaths786 4 ай бұрын
Very good Aryan
@jaisingh64
@jaisingh64 4 ай бұрын
2N is same as N no?
@ARYANMITTAL
@ARYANMITTAL 3 ай бұрын
Broooooo ❤️❤️❤️
@jaisingh64
@jaisingh64 4 ай бұрын
bro cant we use sliding window logic and take two function strictly inc and strictly dec and get the max from the values we from from the two function?
@learningmaths786
@learningmaths786 4 ай бұрын
Yeah sure we can do it but it takes 2 pass 2*n
@ARYANMITTAL
@ARYANMITTAL 4 ай бұрын
Don't Trust Leetcode on this - kzbin.info7hb7OWEa_w0?feature=share
@ARYANMITTAL
@ARYANMITTAL 4 ай бұрын
Problem A: kzbin.info/www/bejne/bambknabgbWLd6M Problem B: kzbin.info/www/bejne/jYCQfaxpn5h0i5Y Problem C: kzbin.info/www/bejne/iaKokKSsept5mKs Problem D: kzbin.info/www/bejne/g528eo2oiseYeZY
@vikash-sinhaCS
@vikash-sinhaCS 4 ай бұрын
vai kon sa tab/device use krte ho!!!!!!
@ARYANMITTAL
@ARYANMITTAL 3 ай бұрын
Bhai Sam Sung S6 lite🙇, sasta tikao 🤌🏻
@HariKrishnan-ff4hf
@HariKrishnan-ff4hf 3 ай бұрын
class Solution { public: int longestMonotonicSubarray(vector& nums) { int maxi=0; int n = nums.size(),count1=1,count2=1; for(int i=1;i nums[i-1]) {//increasing count1++; } else{ maxi=max(maxi,count1); count1=1; } if(nums[i] < nums[i-1]) {//decreasing count2++; } else{ maxi=max(maxi,count2); count2=1; } } maxi=max({maxi,count1,count2}); return maxi; } };
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
Spot The Fake Animal For $10,000
00:40
MrBeast
Рет қаралды 195 МЛН
НЫСАНА КОНЦЕРТ 2024
2:26:34
Нысана театры
Рет қаралды 1,5 МЛН
Sliding Window Technique - Algorithmic Mental Models
36:45
Ryan Schachte
Рет қаралды 337 М.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
Rob Mulla
Рет қаралды 265 М.
678. Valid Parenthesis String | DP | Stacks | 2 Pointers | 3 Ways
39:12
DP 43. Longest Increasing Subsequence | Binary Search | Intuition
16:27
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 633 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 347 М.
you will never ask about pointers again after watching this video
8:03
Low Level Learning
Рет қаралды 2,1 МЛН
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45