Тёмный

L10. Count number of Nice subarrays | 2 Pointers and Sliding Window Playlist 

take U forward
Подписаться 597 тыс.
Просмотров 28 тыс.
50% 1

Notes/Codes/Problem links under step 10 of A2Z DSA Course: takeuforward.org/strivers-a2z...
Entire playlist: • Two Pointer and Slidin...
Follow us on our other social media handles: linktr.ee/takeuforward

Опубликовано:

 

25 мар 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 29   
@messiisthebest
@messiisthebest 2 месяца назад
i have been watching your video since 2 week, now I solved this without watching your video, whole credit goes to you
@vrandakansal5940
@vrandakansal5940 3 месяца назад
The way u change this problem to the previous question.. amazing. Thanks a lot😀💯
@Cool96267
@Cool96267 Месяц назад
Thankyou so much Striver for all you efforts throughout in delivering us so much valuable content. Any student / working professional can now be able to transition their career without paying money for courses. Would also like your insights on the point : While preparing for interviews most of the aspirants are going through the videos solely and solving the question after completely watching the video. And also are feeling lazy trying to solve the question on our own. What is the best way to complete any topic without being lazy and how should an aspirant approach any topic/playlist?
@tgayush1424
@tgayush1424 Месяц назад
add this to your title - 1248. leetcode question number , such that it will come on top search .
@user-yz9mk2jf1j
@user-yz9mk2jf1j 2 месяца назад
this is the best channel
@cenacr007
@cenacr007 Месяц назад
Do add Leetcode question number as well in video title for better search results.
@sriramphysics5853
@sriramphysics5853 3 месяца назад
very good striver
@Madhu-tl8kq
@Madhu-tl8kq 3 месяца назад
There is a type the inner while loop should check while(map.size() > k ) then only we need to reduce the frequency
@prabhakaran5542
@prabhakaran5542 Месяц назад
Understood ❤
@satraprathore5349
@satraprathore5349 2 месяца назад
Mindblown
@aaranyaksantra9933
@aaranyaksantra9933 23 дня назад
nice explaination
@user-lt2ie8ys3n
@user-lt2ie8ys3n 12 дней назад
Striver on a different level
@indian3412
@indian3412 8 дней назад
but it wont work for the test case: [2,2,2,1,2,2,1,2,2,2] k=2 Because at l=0 r=0, r will reach upto last index because sum
@ahappyperson6530
@ahappyperson6530 7 дней назад
here we are using O(4N) TC at worst case but there's a better approach to solve it with [TC = O(N) & SC = O(1)]
@ramakrishnakcr4417
@ramakrishnakcr4417 2 месяца назад
understood
@karamveeryadav8824
@karamveeryadav8824 День назад
striver we want strings and stack playlist
@nakulchauhan6713
@nakulchauhan6713 2 месяца назад
there is no need for modifying array to 0 and 1. We can just use sliding window with concept of finding subarrays with odd numbers less the k - subarrays with odd numbers less then k-1
@lakshsinghania
@lakshsinghania Месяц назад
yeah tru dat, he just did so that to convert into the prev qs
@Deepak_chakravarti
@Deepak_chakravarti 8 дней назад
Finally mil gya 🥲
@lol_xoxo78
@lol_xoxo78 8 дней назад
3:15 AM at night 🌃
@GeetainSaar
@GeetainSaar 8 дней назад
@prabhakaran5542
@prabhakaran5542 Месяц назад
1248. Leetcode problem
@RajatMishra-ks7ns
@RajatMishra-ks7ns Месяц назад
solutions: class Solution { public: int solve(vector& nums, int k){ if(k
@dayashankarlakhotia4943
@dayashankarlakhotia4943 3 месяца назад
public int numberOfSubarrays(int[]nums,int k){ int n=nums.length; int[]cnt=new int[n+1]; cnt[0]=1; int sum=0,ans=0; for(int num:nums){ sum+=num%2; if(sum>=k) ans+=cnt[sum-k]; cnt[sum]++; } return ans; } 🎉❤
@pranjalkumar8909
@pranjalkumar8909 2 месяца назад
I think it will fail for a=[2,4,6] and k=2
@es_amit
@es_amit Месяц назад
nhi bro maine khud solve kiya toh fail nhi hua bs func me if(k
@Harsh-jc2bz
@Harsh-jc2bz Месяц назад
@@es_amit tum kitnai saal k ho?
@es_amit
@es_amit Месяц назад
@@Harsh-jc2bz 20 kyu kuch kaam hai?
@ManishKumar-dk8hl
@ManishKumar-dk8hl 2 месяца назад
class Solution { public int helpMe(int[] nums,int goal){ int l=0; int r=0; int sum=0; int cnt=0; if(goal
Далее
8 patterns to solve 80% Leetcode problems
7:30
Просмотров 206 тыс.
10 Math Concepts for Programmers
9:32
Просмотров 1,8 млн
How I would learn Leetcode if I could start over
18:03
Просмотров 279 тыс.
Erdős-Woods Numbers - Numberphile
14:12
Просмотров 73 тыс.