Count number of nice subarrays | LeetCode | Sliding window | Prefix sum | Hashing | DSA
Problem link:
leetcode.com/problems/count-n...
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
Пікірлер: 42
great logical thinking👍
The outstanding logic 🤯
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!
amazing, didn't think of using an existing solution. Thankyou!
loved the idea to solve, man you made this into such a easy one cant tell you
Excellent explanation, and broken down well. Your explanation is quite intuitive to understand.
quite a good approach man I like it
you are an artist bro, upload more videos and imrove videos you will go long way :)
Nice video Sir, thanks again.
bhai jordar approach hai
Amazing, thanks a ton!!!
@adityarajiv6346
2 жыл бұрын
Glad you liked it!. Please share the channel with all your friends and subscribe.
I downloaded yesterday and watched....n I came today again just to comment...thankyou so much
Excellent brother
What an amazing approach sir👍🙌 Can you please list down a few questions relating to this concept?
@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
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
SC is O(n) ? Because it using an extra prefix array to store the counts.
Bhai mjaa aa gya shi mai
can you please mention(problems links) which all other questions are based on this same approach ?
greatttt
Great
nice video
Great Explanation Bro !!!
@adityarajiv6346
2 жыл бұрын
Glad you liked it
Also, can you solve "Count number of good subarrays" Recent LC contest question: LC 2537
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
6 ай бұрын
its the most basic question of dsa, u need to know that
@BobMarley-qh2qs
6 ай бұрын
@@dustbiny.3968 ni hori yrr dsa BC !!
Can we solve this without extra space and linear time complexity??
@suchithreddy733
Жыл бұрын
I dont think you can
What is sum=y and sum=x? Can you give examples? I don't understand that part 6:12
woah
@adityarajiv6346
2 жыл бұрын
Please share the channel with all your friends and subscribe 😀🙏.
Great, but how to Identify this type of question
@adityarajiv6346
2 жыл бұрын
by practice and observation
bro it is not optimal , TC-> O(n) , SC - > O(n) , interviewer would say to optimize it to SC O(1)
jhaanu
Not for beginners 💀☠️
Not good explanation, unreadable code