Spiral Traversal of a Matrix | Spiral Matrix

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ต.ค. 2024

ความคิดเห็น • 310

  • @shubhamagarwal1434
    @shubhamagarwal1434 2 หลายเดือนก่อน +19

    #Free Education For All.. # Bhishma Pitamah of DSA...You could have earned in lacs by putting it as paid couses on udamey or any other elaerning portals, but you decided to make it free...it requires a greate sacrifice and a feeling of giving back to community, there might be very few peope in world who does this...."विद्या का दान ही सर्वोत्तम दान होता है" Hats Off to you man, Salute from 10+ yrs exp guy from BLR, India.....

  • @navkaransingh3948
    @navkaransingh3948 ปีที่แล้ว +167

    Hi striver, i think you already know but these series will be legacy for future coding students
    So, i hope you don't rush this series
    I'm saying this because i am seeing a lot of comments saying to complete it very fast.

    • @takeUforward
      @takeUforward  ปีที่แล้ว +159

      Yes I will be going at my pace, don't want to compromise on quality.

    • @shivamprajapati8662
      @shivamprajapati8662 ปีที่แล้ว +2

      thank you @@takeUforward

    • @gokulanvs
      @gokulanvs 11 หลายเดือนก่อน +1

      ​@@takeUforwardthank you so much bro❤

    • @Manoj_study
      @Manoj_study 2 หลายเดือนก่อน +6

      True that in 2024 still can't find a better DSA course than this 🫡

  • @AbhinayKrishna4
    @AbhinayKrishna4 9 หลายเดือนก่อน +11

    Man you literally are a lifesaver, providing such a one stop destination for all the coding questions required to crack any interview.Thanks, striver for your dedication and hard work towards providing quality content.

  • @juliechoudhary9582
    @juliechoudhary9582 ปีที่แล้ว +20

    This course is really worth more than any course but still it is free.Thank you so much.

  • @habeeblaimusa4466
    @habeeblaimusa4466 ปีที่แล้ว +27

    Understood.
    The height of this series is you knowing how the code will be after the dry run..
    Thank you Striver

  • @yashkhatri3636
    @yashkhatri3636 ปีที่แล้ว +25

    you are providing such an amazing content at free of cost really india needs man like you !🤠

  • @ruchirtd1
    @ruchirtd1 ปีที่แล้ว +8

    Finally was able to solve this problem with 100% understanding! Thanks a lot.

  • @ashokuta
    @ashokuta 18 วันที่ผ่านมา +1

    Nuvvu thopu guru, awesome

  • @yashgarg1961
    @yashgarg1961 ปีที่แล้ว +4

    Saw several videos on this question. This was the perfect and the easiest one. Hats off to you bhaiya. Thanks for such quality content :)

  • @pawanshimpi_dev
    @pawanshimpi_dev 12 วันที่ผ่านมา

    @takeUforward The solution can be simplified by removing the if conditions on internal for loops and writing the exit condition of the while loop as
    while(ans.length < m * n)
    This way the loop will never run if all the cells have been visited

  • @shreeyarao8265
    @shreeyarao8265 10 หลายเดือนก่อน +4

    So well explained! Understood every bit of it!

  • @vaibhavchaudhary4966
    @vaibhavchaudhary4966 16 วันที่ผ่านมา +1

    What a super clean implementation dude! hats off!

  • @tonylee1868
    @tonylee1868 ปีที่แล้ว +11

    great content...
    i know it will be very difficult for you but we need more videos as soon as possible

    • @JK-de2gh
      @JK-de2gh 2 หลายเดือนก่อน +1

      we don't need like this...we need quality...take your own time striver...

  • @lucario404
    @lucario404 ปีที่แล้ว +3

    edge cases are mat[m][1] and mat[1][n], because of which 2 checks are needed

  • @enzaki7603
    @enzaki7603 3 หลายเดือนก่อน +2

    Thank You Striver Bhaiya !
    Your playlist is really helping me a lot :)

  • @suraj_patwa
    @suraj_patwa ปีที่แล้ว +2

    Really this is a better to paid course
    Thank you striver bhiya

  • @indroneelgoswami5654
    @indroneelgoswami5654 2 หลายเดือนก่อน +3

    Unbelievable Explanation!!

  • @mukeshKumar-go5cz
    @mukeshKumar-go5cz ปีที่แล้ว +3

    thank you for providing best content for us.
    we really love it.

  • @ProgrammingKT
    @ProgrammingKT 9 หลายเดือนก่อน

    Java Solution : th-cam.com/video/cMHzWhBUON4/w-d-xo.html

  • @shadowslayer2248
    @shadowslayer2248 5 หลายเดือนก่อน +1

    Understood. Thank you for striving for us and surely we'll also strive to make your channel and the A2Z course be rated as the best in the world.

  • @atharva_g_vlogs
    @atharva_g_vlogs 2 หลายเดือนก่อน +10

    UNDERSTOOD!!!!
    HAPPY FRIENDSHIP DAY STRIVER

  • @neoh1471
    @neoh1471 ปีที่แล้ว +4

    your solution is good, but i have another idea, i'm using javascript shift(), pop() and reverse() to get the array element into my answer array, then every time i process a row, i'll transpose the matrix and i will reverse() it if needed, then repeat untill the matrix become empty, and print the answer array. All code is written in a while loop with lambda functions.
    let ans = []
    while(matrix.length != 0){
    matrix.shift().forEach(x => ans.push(x));
    if(matrix.length == 0) break;
    matrix = matrix[0].map((_,colIndex) => matrix.map(row => row[colIndex]));
    matrix.pop().forEach(x => ans.push(x));
    if(matrix.length == 0) break;
    matrix = matrix[0].map((_,colIndex) => matrix.map(row => row[colIndex]));
    matrix.pop().reverse().forEach(x => ans.push(x));
    if(matrix.length == 0) break;
    matrix = matrix[0].map((_,colIndex) => matrix.map(row => row[colIndex]));
    matrix.shift().reverse().forEach(x => ans.push(x));
    if(matrix.length == 0) break;
    matrix = matrix[0].map((_,colIndex) => matrix.map(row => row[colIndex]));
    }
    // print ans here

  • @bhagyashreekhairnar683
    @bhagyashreekhairnar683 9 หลายเดือนก่อน +1

    great explanation as always!! really clear!! Please continue making these videos.

  • @leetcoder6569
    @leetcoder6569 ปีที่แล้ว +7

    Why there's so much rush in CB, RAJ BHAIYA is a human being too, we have sheet na, we canbdo it on our own pace..

  • @rishabh1S
    @rishabh1S ปีที่แล้ว +2

    Very good explaination!! Thanks Striver.

  • @cinime
    @cinime ปีที่แล้ว +4

    Understood! Wonderful explanation as always, thank you very very much for your effort!!

  • @Manishgupta200
    @Manishgupta200 ปีที่แล้ว +2

    Understood ❤ I do it by two different technique. Approach is same but condition is different

  • @akashverma5756
    @akashverma5756 ปีที่แล้ว +5

    Simulation approach is more intuitive and clean if you uderstand direction co-ordinate. Direction co-ordinate help you solve many other matrix problems easily.

  • @amankumarverma8426
    @amankumarverma8426 3 หลายเดือนก่อน +1

    amazing approach!

  • @AmareshwarBhat800
    @AmareshwarBhat800 6 หลายเดือนก่อน

    Hi @takeUforward I did not get the last contraint from your explaination as you are too fast at the end. But I got it. Thanks for the video.

  • @ImRich-xo8cm
    @ImRich-xo8cm หลายเดือนก่อน

    Whenever I see you I got inspired ❤

  • @AniketKumar-hf2bo
    @AniketKumar-hf2bo 9 หลายเดือนก่อน +1

    understood ,thnx for excellent explanation ❤❤❤❤❤❤

  • @Ri-hg6hs
    @Ri-hg6hs ปีที่แล้ว

    providing these well structured series by you feeling like that giving water to tree thnx by core of heart.

  • @who__are___you____26__
    @who__are___you____26__ 6 หลายเดือนก่อน

    Thank you very much for this course learnt a lot and your dedication is on another level you were recording this video on 3 am thanks a lot 🙌🙌

  • @raynwani137
    @raynwani137 9 หลายเดือนก่อน

    Bhai U are an Inspiration kasam se Career wise!

  • @KesavaReddyKuppireddygari
    @KesavaReddyKuppireddygari 11 หลายเดือนก่อน +43

    watch in 1.25 is a myth

    • @iAnuragJha
      @iAnuragJha 3 หลายเดือนก่อน

      true that

    • @Try_me_
      @Try_me_ หลายเดือนก่อน +2

      wdym? im watching all his videos in 1.5x

  • @milindjarsaniya
    @milindjarsaniya ปีที่แล้ว +1

    UNDERSTOOD as always!

  • @hrushi_borhade
    @hrushi_borhade ปีที่แล้ว +2

    Thank you striver for great content!!

  • @chinnadhodlekavitha6540
    @chinnadhodlekavitha6540 3 หลายเดือนก่อน +1

    Please add videos related to strings as soon as possible.

  • @kanikagyamlani
    @kanikagyamlani 6 หลายเดือนก่อน

    This is one of the hardest questions I have come across in a while

    • @ce038_divanshsingh3
      @ce038_divanshsingh3 6 หลายเดือนก่อน

      And u r also looking hard.😊

    • @Yup728
      @Yup728 5 หลายเดือนก่อน

      @@ce038_divanshsingh3 chill bro wth u saying

  • @a_maxed_out_handle_of_30_chars
    @a_maxed_out_handle_of_30_chars ปีที่แล้ว +2

    this was good, thank you bhrata :)

  • @studentOfCoding
    @studentOfCoding 25 วันที่ผ่านมา

    great explanation!

  • @infernogamer52
    @infernogamer52 ปีที่แล้ว +1

    Understood Bhaiya!

  • @indroneelgoswami5654
    @indroneelgoswami5654 2 หลายเดือนก่อน +1

    unbelievable explanation!!

  • @NazeerBashaShaik
    @NazeerBashaShaik 10 หลายเดือนก่อน

    Great explanation as usual. Thank you.

  • @NitinKumar-wm2dg
    @NitinKumar-wm2dg ปีที่แล้ว +1

    Thank you bhaiya, understood

  • @MMirabel
    @MMirabel 11 หลายเดือนก่อน

    Understood..Very clean explanation!

  • @sarangkumarsingh7901
    @sarangkumarsingh7901 7 หลายเดือนก่อน

    Another Awesome Lecture Sir............

  • @kingbadshah452
    @kingbadshah452 9 หลายเดือนก่อน

    thanks striver understood everything

  • @rohandhalpe9084
    @rohandhalpe9084 ปีที่แล้ว +5

    Sir please , upload videos as fast as possible. 📤📤📤🕔🕔🕔
    No more time remaining for our placement

    • @notcliche4864
      @notcliche4864 ปีที่แล้ว +6

      Are bro, wo bhi toh insan ha ek saath kitna kaam krega

    • @alokkumarmishra5172
      @alokkumarmishra5172 ปีที่แล้ว

      bhai sath me dp series ya graph ya tree series padh sakta hai it also help for your upcoming placements

    • @aman_singh__
      @aman_singh__ ปีที่แล้ว

      bro tum wait karoge to nhi hoga khud se karne ka try karo. ek banda akele kitna hi kar lega

    • @rohandhalpe9084
      @rohandhalpe9084 ปีที่แล้ว

      @@aman_singh__ 🙌

  • @ProgrammingKT
    @ProgrammingKT 9 หลายเดือนก่อน

    Nice explanation!

  • @diyaghosh3721
    @diyaghosh3721 3 หลายเดือนก่อน

    understood! amazing explanation!!

  • @priyachauhan813
    @priyachauhan813 ปีที่แล้ว

    Understood at one go Thank You Striver

  • @ru_mum77
    @ru_mum77 4 หลายเดือนก่อน

    Sir Thanks a lot for the excellent explanation 😁

  • @harshilpatel3205
    @harshilpatel3205 2 หลายเดือนก่อน +1

    Understood 🙏🏻

  • @ishangujarathi10
    @ishangujarathi10 ปีที่แล้ว +1

    lovedd the intuition

  • @konankikeerthi
    @konankikeerthi 4 หลายเดือนก่อน

    Thank you bro. understood clearly.

  • @hareshnayak7302
    @hareshnayak7302 7 หลายเดือนก่อน

    Understood,Thanks striver for this amazing video.

  • @SibiRanganathL
    @SibiRanganathL 9 หลายเดือนก่อน +1

    Understood.

  • @shristipurusarthi6675
    @shristipurusarthi6675 ปีที่แล้ว

    thank you soo much brother for the wonderful explanation

  • @anshusharma0052
    @anshusharma0052 25 วันที่ผ่านมา

    its amazing 🤩😻

  • @torishi82
    @torishi82 3 หลายเดือนก่อน

    Samaj aa gaya!!

  • @abhishek__anand__
    @abhishek__anand__ ปีที่แล้ว

    Great Explanation

  • @VineetKumar-fk2rl
    @VineetKumar-fk2rl ปีที่แล้ว

    Understood amazing explanation as always❤❤

  • @sayakghosh5104
    @sayakghosh5104 ปีที่แล้ว

    Understood! Awesome explanation.

  • @khalasianiket816
    @khalasianiket816 3 หลายเดือนก่อน +1

    understood❤

  • @pratyushtripathi1728
    @pratyushtripathi1728 11 หลายเดือนก่อน +1

    Understood 😊

  • @priyankavasam8769
    @priyankavasam8769 ปีที่แล้ว

    wonderful explanation

  • @tarushidubey2973
    @tarushidubey2973 ปีที่แล้ว

    you are amazing sir huge respect ...

  • @dinimeegada9167
    @dinimeegada9167 ปีที่แล้ว

    Understood
    I have been waiting for this video from Striver anna
    ❤️ U Anna

  • @hariomatkar4689
    @hariomatkar4689 ปีที่แล้ว

    Itne aasan se bataya ki aadha dekhke hi pura pta chal gya

  • @p4avinash
    @p4avinash ปีที่แล้ว

    Understood, Great explanation.

  • @moharramansari2594
    @moharramansari2594 ปีที่แล้ว +1

    The way you explain

  • @transformers-ai
    @transformers-ai 3 หลายเดือนก่อน +1

    Understood

  • @samuelfrank1369
    @samuelfrank1369 8 หลายเดือนก่อน

    Understood. Thanks a lot

  • @sri-z5d
    @sri-z5d 3 วันที่ผ่านมา

    understood bhaiii

  • @quickknowledge1401
    @quickknowledge1401 ปีที่แล้ว

    Best approach

  • @lakshsinghania
    @lakshsinghania 5 หลายเดือนก่อน

    I saw at the bottom "last saved on" 3:57 AM 3:58 AM 4:00 AM" orz striver bhaiya, staying awake and recording the lecture at late night

  • @oyeesharme
    @oyeesharme หลายเดือนก่อน

    thanks bhaiya

  • @gautamsaxena4647
    @gautamsaxena4647 หลายเดือนก่อน

    understood bhaiya

  • @falaknaaz789
    @falaknaaz789 ปีที่แล้ว +1

    Thank you sir❤

  • @reddygopichand2002
    @reddygopichand2002 11 หลายเดือนก่อน

    Understood thanks 👍🙏

  • @AjeyaKumaraK
    @AjeyaKumaraK 4 หลายเดือนก่อน +1

    understanding

  • @Shivi32590
    @Shivi32590 3 หลายเดือนก่อน +1

    understood

  • @GhostVaibhav
    @GhostVaibhav ปีที่แล้ว +1

    Understood🔥

  • @TanyaTa-ex6mk
    @TanyaTa-ex6mk ปีที่แล้ว

    Thankyou dada🙏🏻🙏🏻🧡

  • @student_03
    @student_03 ปีที่แล้ว

    understood sir thanks a lot

  • @aadityapanchal8551
    @aadityapanchal8551 4 หลายเดือนก่อน

    great job

  • @Sachin-x4m7c
    @Sachin-x4m7c 7 หลายเดือนก่อน

    I was able to solve this by myself but used one pointer only, this is very easy than my code lmao

  • @Sumeet_100
    @Sumeet_100 ปีที่แล้ว

    just amazing !!

  • @debasishbhol777
    @debasishbhol777 3 หลายเดือนก่อน

    Thanks bro !!

  • @SYCOA12CHAITANYAASOLE
    @SYCOA12CHAITANYAASOLE 5 หลายเดือนก่อน

    Understood !! 😍😍

  • @star-yz3xv
    @star-yz3xv 4 หลายเดือนก่อน +1

    If there is already a while loop that says top

  • @juhichoudhary9281
    @juhichoudhary9281 11 หลายเดือนก่อน

    Understood ❤‍🔥❤‍🔥

  • @computerscience68
    @computerscience68 ปีที่แล้ว

    Thank You Bhaiya 😊

  • @shubhammeena2316
    @shubhammeena2316 ปีที่แล้ว

    thank you so much bhaiya

  • @Learnprogramming-q7f
    @Learnprogramming-q7f 8 หลายเดือนก่อน

    Thank you Bhaiya

  • @palkasandeep2313
    @palkasandeep2313 ปีที่แล้ว

    Growing day by day in dsa

  • @SatyaMantha
    @SatyaMantha 27 วันที่ผ่านมา

    Striver is amazing

  • @AshishSingh-he2qo
    @AshishSingh-he2qo 5 หลายเดือนก่อน +1

    Is there any way so that i can like this video more than 1 time ❤❤