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

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

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
@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; } };
@vikash-sinhaCS
@vikash-sinhaCS 4 ай бұрын
vai kon sa tab/device use krte ho!!!!!!
@ARYANMITTAL
@ARYANMITTAL 3 ай бұрын
Bhai Sam Sung S6 lite🙇, sasta tikao 🤌🏻
@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
Sigma girl and soap bubbles by Secret Vlog
00:37
Secret Vlog
Рет қаралды 15 МЛН
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Паша Осадчий
Рет қаралды 10 МЛН
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
Why The Windows Phone Failed
24:08
Apple Explained
Рет қаралды 241 М.
2751. Robot Collisions | Stack | Sorting | Not Hard 🫡
19:30
Aryan Mittal
Рет қаралды 6 М.
Why Do Bubbles Form In Glasses Of Water?
12:33
Joe Scott
Рет қаралды 92 М.
Sigma girl and soap bubbles by Secret Vlog
00:37
Secret Vlog
Рет қаралды 15 МЛН