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

  • @akshadgupta3925
    @akshadgupta39257 күн бұрын

    great logical thinking👍

  • @akashpal7748
    @akashpal77486 ай бұрын

    The outstanding logic 🤯

  • @thegreekgoat98
    @thegreekgoat98 Жыл бұрын

    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!

  • @sujayshanbhag2055
    @sujayshanbhag205510 ай бұрын

    amazing, didn't think of using an existing solution. Thankyou!

  • @anshaggarwal6004
    @anshaggarwal60042 жыл бұрын

    loved the idea to solve, man you made this into such a easy one cant tell you

  • @undergrad4980
    @undergrad4980 Жыл бұрын

    Excellent explanation, and broken down well. Your explanation is quite intuitive to understand.

  • @kyakya6490
    @kyakya64902 жыл бұрын

    quite a good approach man I like it

  • @AmitKumar-xr6cy
    @AmitKumar-xr6cy2 жыл бұрын

    you are an artist bro, upload more videos and imrove videos you will go long way :)

  • @deliveringIdeas
    @deliveringIdeas Жыл бұрын

    Nice video Sir, thanks again.

  • @hiteshbhatia5609
    @hiteshbhatia5609 Жыл бұрын

    bhai jordar approach hai

  • @kshitijgaur9635
    @kshitijgaur96352 жыл бұрын

    Amazing, thanks a ton!!!

  • @adityarajiv6346

    @adityarajiv6346

    2 жыл бұрын

    Glad you liked it!. Please share the channel with all your friends and subscribe.

  • @donthularuchitha7552
    @donthularuchitha755210 ай бұрын

    I downloaded yesterday and watched....n I came today again just to comment...thankyou so much

  • @cdrrjt5005
    @cdrrjt5005 Жыл бұрын

    Excellent brother

  • @hiteshgurnani4633
    @hiteshgurnani46333 жыл бұрын

    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

  • @parthkaushik8365
    @parthkaushik83656 ай бұрын

    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

  • @mart542
    @mart5422 жыл бұрын

    SC is O(n) ? Because it using an extra prefix array to store the counts.

  • @sukhpreetsingh5200
    @sukhpreetsingh5200 Жыл бұрын

    Bhai mjaa aa gya shi mai

  • @umeshkaushik710
    @umeshkaushik7104 ай бұрын

    can you please mention(problems links) which all other questions are based on this same approach ?

  • @vinayakdubey7823
    @vinayakdubey78232 жыл бұрын

    greatttt

  • @champion5946
    @champion5946 Жыл бұрын

    Great

  • @impatientgaming9868
    @impatientgaming98683 ай бұрын

    nice video

  • @shantanukumar4081
    @shantanukumar40812 жыл бұрын

    Great Explanation Bro !!!

  • @adityarajiv6346

    @adityarajiv6346

    2 жыл бұрын

    Glad you liked it

  • @notsodope7227
    @notsodope7227 Жыл бұрын

    Also, can you solve "Count number of good subarrays" Recent LC contest question: LC 2537

  • @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

    6 ай бұрын

    its the most basic question of dsa, u need to know that

  • @BobMarley-qh2qs

    @BobMarley-qh2qs

    6 ай бұрын

    @@dustbiny.3968 ni hori yrr dsa BC !!

  • @tejas7379
    @tejas73792 жыл бұрын

    Can we solve this without extra space and linear time complexity??

  • @suchithreddy733

    @suchithreddy733

    Жыл бұрын

    I dont think you can

  • @GrounDweller
    @GrounDweller Жыл бұрын

    What is sum=y and sum=x? Can you give examples? I don't understand that part 6:12

  • @shouryagupta8763
    @shouryagupta87632 жыл бұрын

    woah

  • @adityarajiv6346

    @adityarajiv6346

    2 жыл бұрын

    Please share the channel with all your friends and subscribe 😀🙏.

  • @sayanroy9161
    @sayanroy91612 жыл бұрын

    Great, but how to Identify this type of question

  • @adityarajiv6346

    @adityarajiv6346

    2 жыл бұрын

    by practice and observation

  • @xolo2617
    @xolo2617 Жыл бұрын

    bro it is not optimal , TC-> O(n) , SC - > O(n) , interviewer would say to optimize it to SC O(1)

  • @hritikbhardwaj6636
    @hritikbhardwaj6636 Жыл бұрын

    jhaanu

  • @sohan_here
    @sohan_hereАй бұрын

    Not for beginners 💀☠️

  • @nathann4291
    @nathann42916 ай бұрын

    Not good explanation, unreadable code

Келесі