Count number of nice subarrays | LeetCode | Sliding window | Prefix sum | Hashing | DSA

  Рет қаралды 27,782

Aditya Rajiv

Aditya Rajiv

Күн бұрын

Problem link:
leetcode.com/p...
solution:
ideone.com/ITZTEr
___________________________________________________________________________
All my playlists:
DSA sheet:
• 450 questions DSA sheet
Interview experiences:
• Internship tests/Inter...
Leetcode problems:
• leetcode problems
projects for resume:
• Projects for Resume
Connect with me on LinkedIn:
/ aditya-rajiv-0606491a5
Connect with me on Instagram:
/ adi_rajiv
#leetcode #slidingwindow #prefixsum #hashing #dsa #softwareengineer #SDE #Placement #competitiveprogramming #faang #recursion

Пікірлер: 43
@akashpal7748
@akashpal7748 Жыл бұрын
The outstanding logic 🤯
@akshadgupta3925
@akshadgupta3925 6 ай бұрын
great logical thinking👍
@giulianaolmos4285
@giulianaolmos4285 3 ай бұрын
Thank you so much! I read the solution for this algorithm in Leetcode but couldn't understand it, but you made it really easy to understand.
@visheshmangla8220
@visheshmangla8220 Ай бұрын
nice approach, more intuitive and to be able to come with with than available on neetcode
@donthularuchitha7552
@donthularuchitha7552 Жыл бұрын
I downloaded yesterday and watched....n I came today again just to comment...thankyou so much
@sujayshanbhag2055
@sujayshanbhag2055 Жыл бұрын
amazing, didn't think of using an existing solution. Thankyou!
@hiteshbhatia5609
@hiteshbhatia5609 2 жыл бұрын
bhai jordar approach hai
@parthkaushik8365
@parthkaushik8365 Жыл бұрын
A sub-list refers to a portion or segment of a larger list or sequence. It is created by selecting and extracting a contiguous chunk of elements from the original list. The sublist retains the order of the elements as they appear in the original list. For example, consider the list [1, 2, 3, 4, 5]. A sublist can be created by selecting a subset of the elements, such as [2, 3, 4], which consists of three consecutive elements from the original list. The original list itself is a sub-list of itself. The list [1, 2, 3] will have the following sublists: [1] [1, 2] [1, 2, 3] [2] [2, 3] [3] Given a list of numbers [2, 4, 5, 3, 1, 6, 9, 7, 10, 8, 15, 17] how many sublists does it have? please tell
@thegreekgoat98
@thegreekgoat98 2 жыл бұрын
Thankyou brother. I did many problems with the same concept, but somehow forgot the core concept. I saw this video of your crystal clear explanation and recalled everything. Top notch man!
@undergrad4980
@undergrad4980 2 жыл бұрын
Excellent explanation, and broken down well. Your explanation is quite intuitive to understand.
@kyakya6490
@kyakya6490 2 жыл бұрын
quite a good approach man I like it
@umeshkaushik710
@umeshkaushik710 11 ай бұрын
can you please mention(problems links) which all other questions are based on this same approach ?
@sukhpreetsingh5200
@sukhpreetsingh5200 2 жыл бұрын
Bhai mjaa aa gya shi mai
@cdrrjt
@cdrrjt 2 жыл бұрын
Excellent brother
@anshaggarwal6004
@anshaggarwal6004 3 жыл бұрын
loved the idea to solve, man you made this into such a easy one cant tell you
@deliveringIdeas
@deliveringIdeas 2 жыл бұрын
Nice video Sir, thanks again.
@hiteshgurnani4633
@hiteshgurnani4633 3 жыл бұрын
What an amazing approach sir👍🙌 Can you please list down a few questions relating to this concept?
@adityarajiv6346
@adityarajiv6346 3 жыл бұрын
Yes okay I shall do that as soon as possible. For now in my head I'm getting a question count number if of subarrays with same is even numbers
@shantanukumar4081
@shantanukumar4081 2 жыл бұрын
Great Explanation Bro !!!
@adityarajiv6346
@adityarajiv6346 2 жыл бұрын
Glad you liked it
@impatientgaming9868
@impatientgaming9868 10 ай бұрын
nice video
@kingsman.blood1
@kingsman.blood1 2 жыл бұрын
Great
@AmitKumar-xr6cy
@AmitKumar-xr6cy 2 жыл бұрын
you are an artist bro, upload more videos and imrove videos you will go long way :)
@mart542
@mart542 3 жыл бұрын
SC is O(n) ? Because it using an extra prefix array to store the counts.
@heyOrca2711
@heyOrca2711 4 ай бұрын
Thank You! Brother 18th Sept, 2024
@kshitijgaur9635
@kshitijgaur9635 3 жыл бұрын
Amazing, thanks a ton!!!
@adityarajiv6346
@adityarajiv6346 3 жыл бұрын
Glad you liked it!. Please share the channel with all your friends and subscribe.
@xolo2617
@xolo2617 2 жыл бұрын
bro it is not optimal , TC-> O(n) , SC - > O(n) , interviewer would say to optimize it to SC O(1)
@notsodope7227
@notsodope7227 2 жыл бұрын
Also, can you solve "Count number of good subarrays" Recent LC contest question: LC 2537
@GrounDweller
@GrounDweller 2 жыл бұрын
What is sum=y and sum=x? Can you give examples? I don't understand that part 6:12
@BobMarley-qh2qs
@BobMarley-qh2qs Жыл бұрын
bhai one question tho, like how did u think of that approach , how can u think if we subtract preifx sum with the target we can add the frequency of our answer to final count variable ?
@dustbiny.3968
@dustbiny.3968 Жыл бұрын
its the most basic question of dsa, u need to know that
@BobMarley-qh2qs
@BobMarley-qh2qs Жыл бұрын
@@dustbiny.3968 ni hori yrr dsa BC !!
@tejas7379
@tejas7379 3 жыл бұрын
Can we solve this without extra space and linear time complexity??
@suchithreddy733
@suchithreddy733 2 жыл бұрын
I dont think you can
@sayanroy9161
@sayanroy9161 3 жыл бұрын
Great, but how to Identify this type of question
@adityarajiv6346
@adityarajiv6346 3 жыл бұрын
by practice and observation
@vinayakdubey7823
@vinayakdubey7823 2 жыл бұрын
greatttt
@hritikbhardwaj6636
@hritikbhardwaj6636 Жыл бұрын
jhaanu
@sohan_here
@sohan_here 7 ай бұрын
Not for beginners 💀☠️
@nathann4291
@nathann4291 Жыл бұрын
Not good explanation, unreadable code
Count Subarray sum Equals K | Brute - Better -Optimal
24:09
take U forward
Рет қаралды 393 М.
Leetcode 2401. Longest Nice Subarray | Weekly Contest 2401.
19:54
Code with Alisha
Рет қаралды 7 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 694 М.
one year of studying (it was a mistake)
12:51
Jeffrey Codes
Рет қаралды 344 М.
Count Number of Nice Subarrays - Leetcode 1248 - Python
10:18
NeetCodeIO
Рет қаралды 16 М.
Count Subarrays with Xor as K | This problem clears a lot of concepts
16:50
What P vs NP is actually about
17:58
Polylog
Рет қаралды 149 М.
L9. Binary Subarrays With Sum | 2 Pointers and Sliding Window Playlist
20:27
Big-O Notation - For Coding Interviews
20:38
NeetCode
Рет қаралды 569 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН