3097. Shortest Subarray With OR at Least K II | Sliding Window | 2 Pointers | Bit Manipulation
Vložit
- čas přidán 29. 03. 2024
- In this video, I'll talk about how to solve Leetcode 3095. Shortest Subarray With OR at Least K I & 3097. Shortest Subarray With OR at Least K II
Learn 2 Pointers Basics & where to apply - • 930. Binary Subarrays ...
Practice Problem - • 713. Subarray Product ...
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
I solved it by myself yesterday!
Thanks, great explanation
brilliant solution
hnoest question how do you think of such approaches while the contest itself even if I was given like 10 days to solve this I wouldn't have thought of an approach like this one
mera toh 3rd yr khatam hone ko aya hai abhi bhi nhi hua
aryan mittal legend
you are such a genius! I wish I can be as smart as you one day!
very helpful bro
Well explained and nice test case walk-through man!
Just a small suggestion: you're adding too much drama in your facial expressions on camera, kind of distractive lol
bro many many thanks to you. apne iss week 2 pointer itni ache se explain kiya ki i got this one almost instantly during the contest. You are amazing bhai.
got stuck in removing OR value from starting pointer. I just suck at bit manipulation.
@abhishek pls share your profile or your solution link
I am unable to understand any code
sliding window marathon
yeah even daily problems are of sw
Thanks Aryan
BRO ISSE NAHI HOSAKTA KYA
#define ll long long
#include
using namespace std;
class Solution {
public:
int minimumSubarrayLength(vector& nums, int k) {
mapmp;
int n=nums.size();
ll ans=1e8;
for(int i=0;i=k)return 1;
ll x=nums[i];
ll count=1;
for(int j=i+1;j=k){
ans=min(ans,mp[{i,j}]);
}
}
}
if(ans==1e8){
return -1;
}
return ans;
}
};
nhi