Spiral Traversal of a Matrix | Spiral Matrix

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

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

  • @navkaransingh3948
    @navkaransingh3948 Год назад +139

    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  Год назад +136

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

    • @shivamprajapati8662
      @shivamprajapati8662 10 месяцев назад +2

      thank you @@takeUforward

    • @gokulanvs
      @gokulanvs 9 месяцев назад +1

      ​@@takeUforwardthank you so much bro❤

    • @Manoj_study
      @Manoj_study 8 дней назад

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

  • @shubhamagarwal1434
    @shubhamagarwal1434 21 день назад +7

    #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.....

  • @habeeblaimusa4466
    @habeeblaimusa4466 Год назад +23

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

  • @maccode07
    @maccode07 21 день назад +8

    UNDERSTOOD!!!!
    HAPPY FRIENDSHIP DAY STRIVER

  • @AbhinayKrishna4
    @AbhinayKrishna4 6 месяцев назад +9

    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 Год назад +16

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

  • @yashkhatri3636
    @yashkhatri3636 Год назад +24

    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.

  • @user-gx1cb3ni1r
    @user-gx1cb3ni1r 9 месяцев назад +33

    watch in 1.25 is a myth

  • @enzaki7603
    @enzaki7603 Месяц назад +2

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

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

  • @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 15 дней назад +1

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

  • @indroneelgoswami5654
    @indroneelgoswami5654 21 день назад +1

    Unbelievable Explanation!!

  • @shreeyarao8265
    @shreeyarao8265 8 месяцев назад +4

    So well explained! Understood every bit of it!

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

  • @indroneelgoswami5654
    @indroneelgoswami5654 21 день назад +1

    unbelievable explanation!!

  • @shadowslayer2248
    @shadowslayer2248 3 месяца назад +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.

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

  • @amankumarverma8426
    @amankumarverma8426 Месяц назад +1

    amazing approach!

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

  • @suraj_patwa
    @suraj_patwa Год назад +2

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

  • @chinnadhodlekavitha6540
    @chinnadhodlekavitha6540 Месяц назад +1

    Please add videos related to strings as soon as possible.

  • @lucario404
    @lucario404 Год назад +2

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

  • @mukeshKumar-go5cz
    @mukeshKumar-go5cz Год назад +3

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

  • @cinime
    @cinime Год назад +4

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

  • @AshishSingh-he2qo
    @AshishSingh-he2qo 2 месяца назад +1

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

  • @bhagyashreekhairnar683
    @bhagyashreekhairnar683 7 месяцев назад +1

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

  • @who__are___you____26__
    @who__are___you____26__ 4 месяца назад

    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 🙌🙌

  • @Manishgupta200
    @Manishgupta200 Год назад +1

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

  • @AmareshwarBhat800
    @AmareshwarBhat800 4 месяца назад

    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.

  • @harshilpatel3205
    @harshilpatel3205 24 дня назад +1

    Understood 🙏🏻

  • @raynwani137
    @raynwani137 7 месяцев назад

    Bhai U are an Inspiration kasam se Career wise!

  • @Ri-hg6hs
    @Ri-hg6hs Год назад

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

  • @codeshelf2737
    @codeshelf2737 8 месяцев назад +1

    Understood.

  • @user-cq6en6rd4q
    @user-cq6en6rd4q 4 месяца назад

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

    • @ce038_divanshsingh3
      @ce038_divanshsingh3 4 месяца назад

      And u r also looking hard.😊

    • @Yup728
      @Yup728 3 месяца назад

      @@ce038_divanshsingh3 chill bro wth u saying

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

  • @rishabh1S
    @rishabh1S Год назад +2

    Very good explaination!! Thanks Striver.

  • @torishi82
    @torishi82 Месяц назад

    Samaj aa gaya!!

  • @user-dk3pv4zi2s
    @user-dk3pv4zi2s 2 месяца назад +1

    understanding

  • @AniketKumar-hf2bo
    @AniketKumar-hf2bo 7 месяцев назад +1

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

  • @user-jn5pv6oo9d
    @user-jn5pv6oo9d 5 месяцев назад

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

  • @NitinKumar-wm2dg
    @NitinKumar-wm2dg Год назад +1

    Thank you bhaiya, understood

  • @a_maxed_out_handle_of_30_chars
    @a_maxed_out_handle_of_30_chars 11 месяцев назад +2

    this was good, thank you bhrata :)

  • @AbhishekKumar-cd4gg
    @AbhishekKumar-cd4gg 10 месяцев назад +1

    At times i feel by watching your videos that i am just seeing the solution and at the end it just feel like spoon feeding , there is no feeling if growth in myself
    so i request @takeUforward aka striver to please make a video the correct way to approach a problem and how should be approach to your series and problem . if felt same do give like to ensure the comment reaches out to striver

  • @hrushi_borhade
    @hrushi_borhade Год назад +2

    Thank you striver for great content!!

  • @khalasianiket816
    @khalasianiket816 28 дней назад +1

    understood❤

  • @infernogamer52
    @infernogamer52 Год назад +1

    Understood Bhaiya!

  • @milindjarsaniya
    @milindjarsaniya 10 месяцев назад +1

    UNDERSTOOD as always!

  • @diyaghosh3721
    @diyaghosh3721 Месяц назад

    understood! amazing explanation!!

  • @user-vl4nq6ed7u
    @user-vl4nq6ed7u Год назад +23

    please complete it as soon as possible .

    • @inspiringzone12
      @inspiringzone12 Год назад +8

      Quality is rare with speed

    • @NithinvKumar-uk2he
      @NithinvKumar-uk2he Год назад +2

      Yes please do complete fast it will be so much helpful for our upcoming placements please

  • @transformers-ai
    @transformers-ai Месяц назад +1

    Understood

  • @hareshnayak7302
    @hareshnayak7302 5 месяцев назад

    Understood,Thanks striver for this amazing video.

  • @konankikeerthi
    @konankikeerthi 2 месяца назад

    Thank you bro. understood clearly.

  • @sarangkumarsingh7901
    @sarangkumarsingh7901 5 месяцев назад

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

  • @pratyushtripathi1728
    @pratyushtripathi1728 9 месяцев назад +1

    Understood 😊

  • @ru_mum77
    @ru_mum77 2 месяца назад

    Sir Thanks a lot for the excellent explanation 😁

  • @NazeerBashaShaik
    @NazeerBashaShaik 8 месяцев назад

    Great explanation as usual. Thank you.

  • @Shivi32590
    @Shivi32590 Месяц назад +1

    understood

  • @kingbadshah452
    @kingbadshah452 7 месяцев назад

    thanks striver understood everything

  • @lakshsinghania
    @lakshsinghania 3 месяца назад

    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

  • @MMirabel
    @MMirabel 9 месяцев назад

    Understood..Very clean explanation!

  • @shristipurusarthi6675
    @shristipurusarthi6675 11 месяцев назад

    thank you soo much brother for the wonderful explanation

  • @culeforever5408
    @culeforever5408 10 месяцев назад +1

    understood partially 🤔

  • @priyachauhan813
    @priyachauhan813 Год назад

    Understood at one go Thank You Striver

  • @architmishra0057
    @architmishra0057 11 дней назад

    I Think the last IF condition is irrelevant because by the time the control reaches the last loop, the TOP will be greater than BOTTOM

  • @hariomatkar4689
    @hariomatkar4689 11 месяцев назад

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

  • @ishangujarathi10
    @ishangujarathi10 Год назад +1

    lovedd the intuition

  • @debasishbhol777
    @debasishbhol777 Месяц назад

    Thanks bro !!

  • @nelsonsimson8175
    @nelsonsimson8175 25 дней назад

    In while loop while left

  • @DeadPoolx1712
    @DeadPoolx1712 8 дней назад

    UNDERSTOOD;

  • @VineetKumar-fk2rl
    @VineetKumar-fk2rl 10 месяцев назад

    Understood amazing explanation as always❤❤

  • @dinimeegada9167
    @dinimeegada9167 Год назад

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

  • @ProgrammingKT
    @ProgrammingKT 7 месяцев назад

    Nice explanation!

  • @sayakghosh5104
    @sayakghosh5104 Год назад

    Understood! Awesome explanation.

  • @tarushidubey2973
    @tarushidubey2973 Год назад

    you are amazing sir huge respect ...

  • @aditgulia
    @aditgulia 4 месяца назад

    Techdose has given better answer of this problem

  • @abhishek__anand__
    @abhishek__anand__ Год назад

    Great Explanation

  • @priyankavasam8769
    @priyankavasam8769 Год назад

    wonderful explanation

  • @PSMADHURIHSIIPCMCREG
    @PSMADHURIHSIIPCMCREG Месяц назад

    understood👍

  • @gagankaushik556
    @gagankaushik556 Месяц назад

    thnx

  • @djpro6413
    @djpro6413 Год назад +1

    bhie bhut kadak smja bas tumhi bas last ka spiral ki diagram smaj lo lotebook mai or dry karo smj jauoge viase usne batya ki firat 2 condiotion cheak ho jati hai bas ek line agar print karni hai first two condition se ho jata hai bas topp++ hotnepar us mai vo cheak lagate hai or bottom ke lieye ek cheak taki bottom to tpo value replaced ho jayegi uske liye matlab ki value print nahi honi chiye.
    thanks ..like me if you understood

  • @p4avinash
    @p4avinash Год назад

    Understood, Great explanation.

  • @samuelfrank1369
    @samuelfrank1369 6 месяцев назад

    Understood. Thanks a lot

  • @moharramansari2594
    @moharramansari2594 Год назад +1

    The way you explain

  • @star-yz3xv
    @star-yz3xv 2 месяца назад

    If there is already a while loop that says top

  • @jhanavikumari274
    @jhanavikumari274 4 месяца назад

    Understood 😁

  • @falaknaaz789
    @falaknaaz789 Год назад +1

    Thank you sir❤

  • @student_03
    @student_03 11 месяцев назад

    understood sir thanks a lot

  • @SHAKTI2.O
    @SHAKTI2.O 14 дней назад

    It is very confusing to understand where the right left top and bottom corner lies...I think it is very basic but at the time very confusing also

  • @aadityapanchal8551
    @aadityapanchal8551 2 месяца назад

    great job

  • @user-tk2vg5jt3l
    @user-tk2vg5jt3l 6 месяцев назад

    Thank you Bhaiya

  • @palkasandeep2313
    @palkasandeep2313 10 месяцев назад

    Growing day by day in dsa

  • @shubhammeena2316
    @shubhammeena2316 10 месяцев назад

    thank you so much bhaiya

  • @GhostVaibhav
    @GhostVaibhav Год назад +1

    Understood🔥

  • @reddygopichand2002
    @reddygopichand2002 9 месяцев назад

    Understood thanks 👍🙏

  • @quickknowledge1401
    @quickknowledge1401 Год назад

    Best approach

  • @sayantanpoddar5428
    @sayantanpoddar5428 9 месяцев назад

    understood
    please striver came up with string videos

  • @charan123rams3
    @charan123rams3 Год назад

    thankyou sir love you so much 🥰

  • @user-is6ky7pp2n
    @user-is6ky7pp2n 3 месяца назад

    Understood !! 😍😍

  • @computerscience68
    @computerscience68 Год назад

    Thank You Bhaiya 😊