Count Complete Subarrays in an array:
https://youtu.be/Taj4VhCycRU
https://youtu.be/Taj4VhCycRU
YouTube
Count Complete Subarrays in an Array | Leetcode 2799
This video explains Count Complete Subarrays in an Array using the most optimal sliding window two pointer approach.
-----------------------------------------------------------------------------------------------------------------------------------------…
-----------------------------------------------------------------------------------------------------------------------------------------…
Today's problem is same as yesterday's and many last few problems.
Hence, not making video today.
REFERENCE CODE:-
class Solution {
#define ll long long
public:
long long countSubarrays(vector<int>& nums, int k) {
ll valid_subarrays = 0;
int win_count = 0;
int left = 0,right = 0;
int maximum = *max_element(nums.begin(), nums.end());
int n = nums.size();
while(left<n){
while(right<n and win_count<k){
if(nums[right]==maximum)
win_count++;
right++;
}
if(win_count==k)
valid_subarrays += n-right+1;
if(nums[left]==maximum)
win_count--;
left++;
}
return valid_subarrays;
}
};
Hence, not making video today.
REFERENCE CODE:-
class Solution {
#define ll long long
public:
long long countSubarrays(vector<int>& nums, int k) {
ll valid_subarrays = 0;
int win_count = 0;
int left = 0,right = 0;
int maximum = *max_element(nums.begin(), nums.end());
int n = nums.size();
while(left<n){
while(right<n and win_count<k){
if(nums[right]==maximum)
win_count++;
right++;
}
if(win_count==k)
valid_subarrays += n-right+1;
if(nums[left]==maximum)
win_count--;
left++;
}
return valid_subarrays;
}
};
Find Minimum Time to Reach Last Room 1 & 2 :
https://youtu.be/kGTqCOdXrhE
https://youtu.be/kGTqCOdXrhE
YouTube
Find Minimum Time to Reach Last Room 1 & 2 | Leetcode 3341 and 3342
This video explains the minimum time to reach last room problem which is from leetcode 3341 and Leetcode 3342 using the most optimal dijkstra algorithm.
-----------------------------------------------------------------------------------------------------…
-----------------------------------------------------------------------------------------------------…
Find Minimum Time to Reach Last Room 1 & 2:
https://youtu.be/kGTqCOdXrhE
https://youtu.be/kGTqCOdXrhE
YouTube
Find Minimum Time to Reach Last Room 1 & 2 | Leetcode 3341 and 3342
This video explains the minimum time to reach last room problem which is from leetcode 3341 and Leetcode 3342 using the most optimal dijkstra algorithm.
-----------------------------------------------------------------------------------------------------…
-----------------------------------------------------------------------------------------------------…
Count Number of Balanced Permutations:
https://youtu.be/bNnXXa2a-Jo
https://youtu.be/bNnXXa2a-Jo
YouTube
Count Number of Balanced Permutations | Leetcode 3343
This video explains Count Number of Balanced Permutations using the most optimal dynamic programming recursion with memoization technique.
-------------------------------------------------------------------------------------------------------------------…
-------------------------------------------------------------------------------------------------------------------…
Prerequisite of today's problem,
Count Number of Balanced Permutations: https://youtu.be/bNnXXa2a-Jo
Count Number of Balanced Permutations: https://youtu.be/bNnXXa2a-Jo
YouTube
Count Number of Balanced Permutations | Leetcode 3343
This video explains Count Number of Balanced Permutations using the most optimal dynamic programming recursion with memoization technique.
-------------------------------------------------------------------------------------------------------------------…
-------------------------------------------------------------------------------------------------------------------…
Today's problem: https://youtu.be/1klumzFdwxc
YouTube
Count Number of Maximum Bitwise OR Subsets | Recursion DP | Leetcode 2044
This video explains about finding the count of number of bitwise OR subsets starting from basic recursion approach to detailed dynamic programming conversion and solution using recursion and memoization.
--------------------------------------------------…
--------------------------------------------------…
Checkout the Live session on "Design & Architecture of KAFKA"
SUBSCRIBE for more on System Design
LINK: https://youtu.be/4TezK-w9_W0
SUBSCRIBE for more on System Design
LINK: https://youtu.be/4TezK-w9_W0
YouTube
Kafka System Design | Full Course | Design & Architecture
This video explains the design and architecture of Kafka with detailed analysis with proper real-life use cases.
---------------------------------------------------------------------------------------------------------------------------------------------…
---------------------------------------------------------------------------------------------------------------------------------------------…