Introduction | What | How | Difference Array Technique: Concepts & Questions - 1 | codestorywithMIK

Поделиться
HTML-код
  • Опубликовано: 6 янв 2025

Комментарии • 138

  • @riteshhhhh_01
    @riteshhhhh_01 День назад +29

    Tomorrow's motivation from my side: "There's always light at the end of the tunnel, but not once your eyes shift to the darkness, So whenever you stuck in any problem give time think again think better and eventually you will find out the solution of it"

  • @Dungeon550
    @Dungeon550 День назад +18

    There can be no teacher who explains a problem more beautifully than MIK sir ... Lots of thanks to you SIr..

  • @gui-codes
    @gui-codes 2 дня назад +19

    Dhanya ho Guruji.
    Ye hota hai dedication. POTD se pehle concepts clear karo, then POTD khud ba khud solve hojaega. Thank you so so much MIK

  • @arshlanali5665
    @arshlanali5665 День назад +3

    Excellent work, Mik! I have a small suggestion to enhance the value of your content: consider including a few example questions along with their respective links in the video description. Practicing these examples will help viewers better grasp the concept by applying it to practical scenarios.

  • @GovindLohar-p9e
    @GovindLohar-p9e День назад +4

    i do not know why do you give this type of content free it is helpfull for me as well as other but when you teach that make easy to the question becuase hard question comes in front of you you do not get hesited and make it easy .

  • @AryanSingh-rizz
    @AryanSingh-rizz День назад +4

    Are MIK sir sirf ek hi chiz bolunga apki video ke liye - "aag laga di aag laga di aag laga di"

  • @akashcodeeerrrr
    @akashcodeeerrrr День назад +5

    The channel name CodestorywithMike and the way you teach is 💯 storty to code 🔥

  • @mazinshamshad3838
    @mazinshamshad3838 День назад +5

    Solved it on my own but still came to watch Mike Sir's teaching ❤. This method works well for offline queries, but segment trees or Fenwick trees are better for online queries

    • @namansaini1073
      @namansaini1073 День назад +1

      What are Offline queries and online queries ?

    • @mazinshamshad3838
      @mazinshamshad3838 16 часов назад +1

      ​@@namansaini1073 In Offline queries, all queries are given beforehand, allowing you to preprocess data and answer them in any order after processing whereas Online queries are answered as they arrive one after another

  • @akarsh1821
    @akarsh1821 День назад +4

    At 13:58 we're checking if R+1 is out of bound or not.

  • @atifulhaque
    @atifulhaque День назад +3

    bhai bohot codding or DSA ka video dhaka hai youtuber par . but tum next level per explain karte ho bhai . best video

  • @Pratik-v3s5
    @Pratik-v3s5 День назад +1

    Hi Mik,
    I've been following you since last August when I was stuck on that graph problem of Snake and Ladders. Since then, whenever I'm stuck on a problem for a long time, I refer to your videos. Also followed your many playlists(Graphs, DP, segment Tree, Recursion), they have been a huge help.
    Thanks to consistent practice and solving daily Leetcode and GFG problems (inspired by your content), I cracked multiple companies-recently got 2 offers! I even cleared the OAs of many others, along with the technical rounds but got rejected in some final HR rounds due to experience gaps.
    Your videos have been instrumental in my journey. In fact, after watching this video, I was able to solve today's daily problem. Initially, I was approaching it with a Segment Tree, but your approach made it so much clearer and faster.
    Thank you so much for everything you do! This year, I'm aiming to crack even bigger companies, and I'm determined to put in my best effort.
    Thanks a ton! 🙌

  • @dibbodas4116
    @dibbodas4116 День назад +1

    nice teaching❤❤

  • @AbhijeetMuneshwar
    @AbhijeetMuneshwar День назад +1

    Respected MIK Sir,
    Are Bhai Bhai Bhai 🔥
    Mind blowing explaination ❤️‍🔥

  • @rajbundela3642
    @rajbundela3642 День назад +1

    Great explanation!

  • @sahebraojadhav9727
    @sahebraojadhav9727 2 дня назад +69

    Petition that we want mik to upsolve the contest ⬆⬆

  • @varunmangla2883
    @varunmangla2883 День назад +1

    Just 10 minutes of this video were enough for me to solve today's POTD. You are great sir😌😌

  • @abhaymaurya9
    @abhaymaurya9 День назад +1

    After watching this , POTD is a cake walk
    Thanks MIK❤

  • @harjotanand834
    @harjotanand834 День назад +3

    Sir ....zindagi ki bas ek hi wish hai ....ek baar aapse real life mein mila de ....😭🤌🤌

  • @aws_handles
    @aws_handles День назад +3

    MIK - you are only one and the best 🔥

  • @Amanbhaskar16
    @Amanbhaskar16 День назад +1

    Sir your explanation is god level.

  • @rajashreeparhi1549
    @rajashreeparhi1549 День назад +1

    new concepts learnt! will cover segment tree also

  • @India_mera_sabkuch
    @India_mera_sabkuch 18 часов назад

    MIK sir i love you as a student!!🙂

  • @aryangupta6335
    @aryangupta6335 День назад +1

    Outstandingggggggg ... bhai 😱😱😱♥️♥️

  • @Algo_algae
    @Algo_algae День назад +1

    This is fantasic idea !! if you add more videos like this for every new concepts that we face on leetcode potd then it will help us a lot... like cover thoretical part for the new pattern question

  • @vishwashsoni610
    @vishwashsoni610 День назад +1

    maja he aa gaya ab DSA to game lagne laga hai... sirf aap k intuition k waja se

  • @beinghappy9223
    @beinghappy9223 День назад +1

    Solved today's daily problem by watching this video.

  • @knight-z1x
    @knight-z1x День назад +1

    thankyou sir!!

  • @adityakushwahaiiitbh_2005
    @adityakushwahaiiitbh_2005 День назад +3

    13:58 it would be R+1 < n

  • @harishms5330
    @harishms5330 14 часов назад +1

    thank you so much sir!!

  • @Codewithminutecoder
    @Codewithminutecoder День назад +2

    Great work sir ! Your explanation is clear and helpful. It would be awesome if you could also cover some Leetcode contest problems. Keep up the great work!

  • @priyajaiwal8072
    @priyajaiwal8072 День назад +1

    Sundar!

  • @Thanos_i9
    @Thanos_i9 День назад +3

    Legend Guruji aap please yeh playlist band nhi krna

  • @vishwashsoni610
    @vishwashsoni610 День назад +3

    sir this is how solved today's POTD question after watching your intuition video :
    class Solution {
    public:
    string shiftingLetters(string s, vector& shifts) {
    int n = s.size();
    vectorvec(n,0);
    for(auto& shift : shifts){
    int left = shift[0];
    int right = shift[1];
    int x = shift[2];
    if(x == 1){
    vec[left] += 1;
    if(right + 1 < n){
    vec[right+1] += -1;
    }
    }
    else{
    vec[left] += -1;
    if(right + 1 < n){
    vec[right+1] += 1;
    }
    }
    }
    for(int i=1;i

  • @coder4
    @coder4 День назад +2

    Bhaiya how about start something like one shots about all DSA topics like 0 to hero in that specific topic , concepts then patterns then all interviews questions (important) like this for all DSA topics like arrays, strings, stacks, queues,trees, searching sorting etcc like duration of 12-15 hours u can think of it in 2025 as a revolution u r the god of DSA it will be very helpful

  • @AliinNITW
    @AliinNITW День назад +1

    Mik bro we want system design playlist.... It would be really helpful when u will make harde concept easy with intuition.....like this comment if u want too

  • @sahilkachhap
    @sahilkachhap 2 дня назад +1

    Sir I knew this concept already, and I quickly understood that today's potd will require this concept, I constructed the difference array but I am stuck in updating the characters of the string when its something like this - character 'b' and it needs to be reduced by 4 (-4) or its 'z' and needs to be increnented by 6

  • @deepbendudebnath9612
    @deepbendudebnath9612 2 дня назад +2

    Thankyou bhaiya concept and question k liye ❤️
    Plz Contest k v playlist chalu kijiye

  • @sahebraojadhav9727
    @sahebraojadhav9727 2 дня назад +1

    Waiting since 7 am

  • @nikhil_squats
    @nikhil_squats 2 дня назад +4

    Please upsolve leetcode contest questions

  • @KalluKumar-lb5jt
    @KalluKumar-lb5jt День назад

    @20:33 sir there is a confusion I think O(4*n) is for t.c.but for s.c it's around O(2n) .....
    It's because we are taking the segtree array of size nearly 2n or 2n-1 appropriately....

    • @codestorywithMIK
      @codestorywithMIK  День назад +1

      Kindly have a look at this where I have explained space - ruclips.net/video/3Iq5x56g_dM/видео.htmlsi=NBHYe2WzBZKtTtn1
      Hope this helps ❤️😇🙏

  • @dayashankarlakhotia4943
    @dayashankarlakhotia4943 2 дня назад +2

    First 🎉❤

  • @nikhil_squats
    @nikhil_squats 2 дня назад +3

    Bug fan Sir
    Any plans to bring Low Level Design in future?

  • @PiyushMehta-km3cb
    @PiyushMehta-km3cb День назад +1

    thanks.

  • @SRoy2700
    @SRoy2700 День назад +2

    Approach 1:brute force : O(M*N) , 37 test case passed
    class Solution {
    public:
    string shiftingLetters(string s, vector& shifts) {
    for(vector &v: shifts){
    int i = v[0];
    int j = v[1];
    int flag = v[2];
    while(i

  • @mathematicslover788
    @mathematicslover788 День назад +1

    i think this type of question also be solved using segment tree

  • @YashSinghal
    @YashSinghal День назад +1

    👏

  • @coderrr611
    @coderrr611 2 дня назад +12

    Apki channel se pura dsa aur alag questions k approach aur logic kese kr sakte hai...please apke playlist ko konsi sequence mei padhe ... guide me i m a beginner

    • @codestorywithMIK
      @codestorywithMIK  2 дня назад +4

      First watch this guide where I mentioned the topic wise how to study -
      ruclips.net/video/gkFxMoTJMzc/видео.htmlsi=Y27suYA_BcdGm6i6

    • @codestorywithMIK
      @codestorywithMIK  2 дня назад +11

      Always remember that we must study DSA topic by topic . First study the topic’s concepts, then solve good Questions on them. Then move to next topic and so on.
      I usually create two playlists for every topic :
      1) Concepts Playlist - Contains from basic concepts to expert concepts.
      2) Popular Interview Problems playlist.
      I have created concepts and interview problems playlist for
      1) Graph
      2) Recursion
      3) DP
      4) Segment Tree
      Planning soon to create concepts playlist for Tree as well.
      Graph Concepts - ruclips.net/p/PLpIkg8OmuX-LZB9jYzbbZchk277H5CbdY&si=lZG2IJTmSW4kRrx-
      Graph Popular Interview Problems - ruclips.net/p/PLpIkg8OmuX-I_49pdy1XFY6OcATnxUrrO&si=CG2JvGWVmvoSqvWA
      Recursion Concepts - ruclips.net/p/PLpIkg8OmuX-IBcXsfITH5ql0Lqci1MYPM&si=614iI4NyHY-FTeJH
      Recursion Problems (In progress) - ruclips.net/p/PLpIkg8OmuX-IXOgDP_YYiJFqfCFKFBDkO&si=88fBhRnr62OYTnDP
      DP Concepts (In progress) - ruclips.net/p/PLpIkg8OmuX-JhFpkhgrAwZRtukO0SkwAt&si=laFVYy6ep2BkOg0s
      DP Popular interview problems - ruclips.net/p/PLpIkg8OmuX-L_QqcKB5abYynQbonaNcq3&si=VHEn9b-wqTnAVyyi
      Segment Tree Concepts -
      ruclips.net/p/PLpIkg8OmuX-K1qUIQToCllUO0UIKXt8dB&si=xm7DqRN4H0eZwna4

    • @coderrr611
      @coderrr611 2 дня назад +3

      Thankyou so much sir, now I will follow it exactly the way you had explained🫡🙏

    • @aditya12881
      @aditya12881 День назад +2

      C++ pai command kaise lye mtlb jo logic socha usko code nhi kr pa rha hai kyu ho rha sir aisa.

    • @aditya12881
      @aditya12881 День назад +2

      C++ pai command kaise lye mtlb jo logic socha usko code nhi kr pa rha hai kyu ho rha sir aisa

  • @kumkumslab5811
    @kumkumslab5811 День назад +1

    Sir Please DIGIT DP par playlist baniye Please sir

  • @Aryan-cy7cu
    @Aryan-cy7cu День назад +2

    surpass ur limits right here & right now

  • @rachitsaini3427
    @rachitsaini3427 10 часов назад

    If you want to try another question using this technique, you can solve Leetcode 1109: Corporate Flight Bookings.

  • @avicious17
    @avicious17 День назад

    Please make a video on Z algorithm

  • @VineetDixit
    @VineetDixit 2 дня назад +2

    bhaiya aaj ka potd

    • @codestorywithMIK
      @codestorywithMIK  2 дня назад +7

      It will require to understand this concept “Difference Array Technique”. The next video will be the POTD.
      So make sure to go through this video first to understand 😇❤️🙏

    • @KeshavKumar-jl1ub
      @KeshavKumar-jl1ub 2 дня назад

      this thing only helps to do the todays pod... i think

  • @amankunwar8621
    @amankunwar8621 День назад

    bhaiya please make a solution video of contest also🙏🙏🙏🙏🙏🙏

  • @dayashankarlakhotia4943
    @dayashankarlakhotia4943 День назад

    Leetcode biweekly qn.no.4 is good variation of segment tree please make video 🎉❤

  • @abhayshukla5175
    @abhayshukla5175 День назад

    Bhaiya please make Bit manipulation concepts video as it is very difficult to learn this concept and no one can teach us better than you

  • @vaibhav454
    @vaibhav454 День назад

    Please Make LeetCode biweekly contest solutions

  • @imPriyansh77
    @imPriyansh77 День назад

    At 14:00, it should be R+1 instead of x+1

  • @BiswajitDas-lk7pp
    @BiswajitDas-lk7pp День назад

    Please do contents also.
    If you will do i will give every leetcode contest.

    • @ananyeagarwal9770
      @ananyeagarwal9770 День назад

      Leetcode Contest video solution in case you want - ruclips.net/video/LhsqM-9-gNk/видео.html&ab_channel=KumarK%5BAmazon%5D .

  • @coderrr611
    @coderrr611 2 дня назад +3

    Sir yesterday's leetcode POTD please 🙏

    • @anmolkumargupta2528
      @anmolkumargupta2528 2 дня назад

      see community page

    • @codestorywithMIK
      @codestorywithMIK  2 дня назад +6

      It was already there in my playlist. Let me share the link here - ruclips.net/video/EdEvy2_o5OE/видео.htmlsi=6CqM0BMEeMLpoGBN
      When I don’t upload, always check the community section in my RUclips profile, i post there the link of the video if it is already present.
      I also post it on
      Whatsapp - whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A
      Instagram Stories - instagram.com/codestorywithmik/profilecard/?igsh=aHhmaXZ1NGNyNTVz
      Hope this helps ❤️😇🙏

    • @coderrr611
      @coderrr611 2 дня назад

      Okay sir thankyou 😄👍

  • @DineshKumar-gt7xm
    @DineshKumar-gt7xm День назад +1

    Sir please make explanation videos on leetcode contest problems 3rd and 4th, the contests are getting harder and harder, so we need explanation videos to understand them.

    • @ananyeagarwal9770
      @ananyeagarwal9770 День назад +1

      Leetcode Contest video solution in case you want - ruclips.net/video/LhsqM-9-gNk/видео.html&ab_channel=KumarK%5BAmazon%5D .

  • @ThakurShahab2510
    @ThakurShahab2510 День назад

    bhaiya shifting letters II ka video bana do

  • @aryanagarwal7903
    @aryanagarwal7903 День назад

    sir please aapne jo bola tha ki saare types of problems ek video me bataunga please wo bta do

  • @mehranahmed3612
    @mehranahmed3612 День назад

    Is it not similar to SWEEP LINE ALGO ?????

  • @Abhi-zn4up
    @Abhi-zn4up День назад +2

    Sir we know u r busy
    But please try to explain some of the difficult problems from contests

    • @ananyeagarwal9770
      @ananyeagarwal9770 День назад

      Leetcode Contest video solution in case you want - ruclips.net/video/LhsqM-9-gNk/видео.html&ab_channel=KumarK%5BAmazon%5D .

    • @Abhi-zn4up
      @Abhi-zn4up День назад

      @ananyeagarwal9770 did you gave today contest

  • @aditya12881
    @aditya12881 День назад

    C++ pai command kaise lye mtlb jo logic socha usko code nhi kr pa rha hai kyu ho rha sir aisa i am beginner sur please help

  • @rushabhlegion2560
    @rushabhlegion2560 День назад

    Hello Mik
    Can you tell me, from where I can start learning System Design Concepts?
    I know C, C++, DSA, Basic OS Concepts, Basic Networking Protocols. Also completed around 600 questions on Leetcode. I'm working in a service based company, and need to switch to a product based company. I've 1 year for preparation, so can you guide me?

  • @bhuppidhamii
    @bhuppidhamii День назад +1

    Kya eg, tha friend wala😂

  • @rode_atharva
    @rode_atharva День назад

    sir ye hum interval mai bhi use karthe thee na

    • @aws_handles
      @aws_handles День назад

      I think Intervals waale me Line Sweep use hota hai na shayad

  • @shreshth1961
    @shreshth1961 День назад +2

    Sir plz line sweep bhi samjha do 🙏

  • @nileshdeshmukh7841
    @nileshdeshmukh7841 День назад

    bhai fir , " Segment Tree" aur isme " Difference Array" me different ky hai , segment tree se bhi range based update kar sakte hai n

    • @codestorywithMIK
      @codestorywithMIK  День назад

      Yes both can be used. But in case of only range queries, this is simple to implement.

  • @Engineeringlife651
    @Engineeringlife651 День назад

    Is dp video are completed I am following your Playlist? Please answer

  • @engineer9503
    @engineer9503 День назад

    Sir how can i get internship at expedia i am a 3rd year student i have 3 semester left and i really want a good internship in next 6 months and Expedia is in my dream company list, please reply sir an how can i prepare for Expedia?

  • @AmarjeetKumar-to9ub
    @AmarjeetKumar-to9ub День назад

    🔥++

  • @aditya12881
    @aditya12881 День назад

    C++ pai command kaise lye mtlb jo logic socha usko code nhi kr pa rha hai kyu ho rha sir aisa

    • @AryanVats603
      @AryanVats603 День назад

      Bro do practice daily..it comes with practice..and it will take some time..

  • @RashikaKaushik-z8s
    @RashikaKaushik-z8s День назад

    Hello Mike, I have been following your channel from a very long tym. But despite of doing potd daily and doing hardwork I am still not able to clear any of the OA rounds of any company. I am feeling very demotivated. I have given the test of many companies but not being able to clear any of them. Sach bolu toh abh mera maan bhi nhi karta kuch karne. Aur nah mujhe abh umeed lag rahe h ke mere placement ho payege. Itna tym hogya h mere sbh dosto ke bhi lag gye h bas mai hi reh gye. Boht burra lag raha. Jise bhi baat karo voh bolta h ho jayega try karo. But aur kitna try karu abh toh opportunities bhi nhi bache h. My 4yr of clg get wasted in just one moment. Sbh khtm ese lag raha h jaise khale haath clg aaye tha vesa hi khale haath jaana padega. Kuch fayada nhi hua yaha aake. Also my family conditions are not good. Maine socha tha ke unke help karunga. But mai kise kaam ka nhi. Boht bekar h sbh kuch. Mujhe kuch smj nhi aa raha ke kya karu. Mera maan bhi nhi kar raha rehne ka. Please help. Pls tell ke mai kya karu.

    • @ananyeagarwal9770
      @ananyeagarwal9770 День назад

      For cracking OA rounds and CP Problems; practice of many hard unseen DSA questions is needed. Leetcode Contest video solution in case you want - ruclips.net/video/LhsqM-9-gNk/видео.html&ab_channel=KumarK%5BAmazon%5D .

  • @pullurupraveen9315
    @pullurupraveen9315 День назад

    it only works on zero

  • @amitkumaryadav7240
    @amitkumaryadav7240 День назад

    didn't understood the logic behind subtracting end index+1 every time

  • @sahebraojadhav9727
    @sahebraojadhav9727 2 дня назад

    Bhyya contest upsolving pe na video ki Jagah direct livestream kiya karo.taki aapka time save ho.yar kuch bhi ho par please contest pe video banya karo

    • @ananyeagarwal9770
      @ananyeagarwal9770 День назад

      Leetcode Contest video solution in case you want - ruclips.net/video/LhsqM-9-gNk/видео.html&ab_channel=KumarK%5BAmazon%5D .

    • @sahebraojadhav9727
      @sahebraojadhav9727 День назад

      @@ananyeagarwal9770 thanks bro