Spiral Traversal of a Matrix | Spiral Matrix

  Рет қаралды 180,738

take U forward

take U forward

Күн бұрын

Problem Link: bit.ly/3InYB3c
Notes/C++/Java/Python codes: takeuforward.org/data-structu...
We have solved the problem, and we have gone from brute force and ended with the most optimal solution. Every approach's code has been written in the video itself. Also, we have covered the algorithm with intuition.
Full Course: bit.ly/tufA2ZYt
You can follow me across social media, all my handles are below:
Linkedin/Instagram/Telegram: linktr.ee/takeUforward
0:00 Introduction of Course

Пікірлер: 259
@shubhamagarwal1434
@shubhamagarwal1434 Күн бұрын
#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 Жыл бұрын
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 Жыл бұрын
Yes I will be going at my pace, don't want to compromise on quality.
@shivamprajapati8662
@shivamprajapati8662 9 ай бұрын
thank you @@takeUforward
@gokulanvs
@gokulanvs 9 ай бұрын
​@@takeUforwardthank you so much bro❤
@maccode07
@maccode07 2 күн бұрын
UNDERSTOOD!!!! HAPPY FRIENDSHIP DAY STRIVER
@juliechoudhary9582
@juliechoudhary9582 Жыл бұрын
This course is really worth more than any course but still it is free.Thank you so much.
@AbhinayKrishna4
@AbhinayKrishna4 6 ай бұрын
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.
@yashkhatri3636
@yashkhatri3636 Жыл бұрын
you are providing such an amazing content at free of cost really india needs man like you !🤠
@ruchirtd1
@ruchirtd1 Жыл бұрын
Finally was able to solve this problem with 100% understanding! Thanks a lot.
@enzaki7603
@enzaki7603 15 күн бұрын
Thank You Striver Bhaiya ! Your playlist is really helping me a lot :)
@shreeyarao8265
@shreeyarao8265 7 ай бұрын
So well explained! Understood every bit of it!
@cinime
@cinime Жыл бұрын
Understood! Wonderful explanation as always, thank you very very much for your effort!!
@mukeshKumar-go5cz
@mukeshKumar-go5cz Жыл бұрын
thank you for providing best content for us. we really love it.
@habeeblaimusa4466
@habeeblaimusa4466 Жыл бұрын
Understood. The height of this series is you knowing how the code will be after the dry run.. Thank you Striver
@shashamnk2525
@shashamnk2525 Жыл бұрын
True
@tonylee1868
@tonylee1868 Жыл бұрын
great content... i know it will be very difficult for you but we need more videos as soon as possible
@Ri-hg6hs
@Ri-hg6hs Жыл бұрын
providing these well structured series by you feeling like that giving water to tree thnx by core of heart.
@bhagyashreekhairnar683
@bhagyashreekhairnar683 6 ай бұрын
great explanation as always!! really clear!! Please continue making these videos.
@yashgarg1961
@yashgarg1961 Жыл бұрын
Saw several videos on this question. This was the perfect and the easiest one. Hats off to you bhaiya. Thanks for such quality content :)
@shadowslayer2248
@shadowslayer2248 2 ай бұрын
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.
@rishabh1S
@rishabh1S Жыл бұрын
Very good explaination!! Thanks Striver.
@hrushi_borhade
@hrushi_borhade Жыл бұрын
Thank you striver for great content!!
@indroneelgoswami5654
@indroneelgoswami5654 2 күн бұрын
Unbelievable Explanation!!
@who__are___you____26__
@who__are___you____26__ 3 ай бұрын
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 🙌🙌
@NazeerBashaShaik
@NazeerBashaShaik 7 ай бұрын
Great explanation as usual. Thank you.
@sayakghosh5104
@sayakghosh5104 Жыл бұрын
Understood! Awesome explanation.
@amankumarverma8426
@amankumarverma8426 10 күн бұрын
amazing approach!
@priyachauhan813
@priyachauhan813 Жыл бұрын
Understood at one go Thank You Striver
@indroneelgoswami5654
@indroneelgoswami5654 2 күн бұрын
unbelievable explanation!!
@milindjarsaniya
@milindjarsaniya 9 ай бұрын
UNDERSTOOD as always!
@diyaghosh3721
@diyaghosh3721 Ай бұрын
understood! amazing explanation!!
@AmareshwarBhat800
@AmareshwarBhat800 3 ай бұрын
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.
@raynwani137
@raynwani137 7 ай бұрын
Bhai U are an Inspiration kasam se Career wise!
@suraj_patwa
@suraj_patwa Жыл бұрын
Really this is a better to paid course Thank you striver bhiya
@shristipurusarthi6675
@shristipurusarthi6675 10 ай бұрын
thank you soo much brother for the wonderful explanation
@MMirabel
@MMirabel 9 ай бұрын
Understood..Very clean explanation!
@ProgrammingKT
@ProgrammingKT 6 ай бұрын
Java Solution : kzbin.info/www/bejne/mX6rq4qed7qChJY
@abhishek__anand__
@abhishek__anand__ Жыл бұрын
Great Explanation
@AniketKumar-hf2bo
@AniketKumar-hf2bo 6 ай бұрын
understood ,thnx for excellent explanation ❤❤❤❤❤❤
@hareshnayak7302
@hareshnayak7302 4 ай бұрын
Understood,Thanks striver for this amazing video.
@tarushidubey2973
@tarushidubey2973 Жыл бұрын
you are amazing sir huge respect ...
@p4avinash
@p4avinash Жыл бұрын
Understood, Great explanation.
@kingbadshah452
@kingbadshah452 6 ай бұрын
thanks striver understood everything
@konankikeerthi
@konankikeerthi 2 ай бұрын
Thank you bro. understood clearly.
@VineetKumar-fk2rl
@VineetKumar-fk2rl 9 ай бұрын
Understood amazing explanation as always❤❤
@priyankavasam8769
@priyankavasam8769 Жыл бұрын
wonderful explanation
@ishangujarathi10
@ishangujarathi10 Жыл бұрын
lovedd the intuition
@Manishgupta200
@Manishgupta200 Жыл бұрын
Understood ❤ I do it by two different technique. Approach is same but condition is different
@sarangkumarsingh7901
@sarangkumarsingh7901 4 ай бұрын
Another Awesome Lecture Sir............
@Sumeet_100
@Sumeet_100 Жыл бұрын
just amazing !!
@user-gx1cb3ni1r
@user-gx1cb3ni1r 8 ай бұрын
watch in 1.25 is a myth
@iAnuragJha
@iAnuragJha Ай бұрын
true that
@samuelfrank1369
@samuelfrank1369 6 ай бұрын
Understood. Thanks a lot
@ProgrammingKT
@ProgrammingKT 6 ай бұрын
Nice explanation!
@dinimeegada9167
@dinimeegada9167 Жыл бұрын
Understood I have been waiting for this video from Striver anna ❤️ U Anna
@student_03
@student_03 10 ай бұрын
understood sir thanks a lot
@NitinKumar-wm2dg
@NitinKumar-wm2dg Жыл бұрын
Thank you bhaiya, understood
@reddygopichand2002
@reddygopichand2002 9 ай бұрын
Understood thanks 👍🙏
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars 10 ай бұрын
this was good, thank you bhrata :)
@harshilpatel3205
@harshilpatel3205 4 күн бұрын
Understood 🙏🏻
@moharramansari2594
@moharramansari2594 Жыл бұрын
The way you explain
@quickknowledge1401
@quickknowledge1401 Жыл бұрын
Best approach
@computerscience68
@computerscience68 Жыл бұрын
Thank You Bhaiya 😊
@leetcoder6569
@leetcoder6569 Жыл бұрын
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..
@lucario404
@lucario404 Жыл бұрын
edge cases are mat[m][1] and mat[1][n], because of which 2 checks are needed
@charan123rams3
@charan123rams3 Жыл бұрын
thankyou sir love you so much 🥰
@ru_mum77
@ru_mum77 Ай бұрын
Sir Thanks a lot for the excellent explanation 😁
@debasishbhol777
@debasishbhol777 26 күн бұрын
Thanks bro !!
@infernogamer52
@infernogamer52 Жыл бұрын
Understood Bhaiya!
@akashverma5756
@akashverma5756 Жыл бұрын
Simulation approach is more intuitive and clean if you uderstand direction co-ordinate. Direction co-ordinate help you solve many other matrix problems easily.
@navkaransingh3948
@navkaransingh3948 Жыл бұрын
Bro, wdym by simulation approach?
@aadityapanchal8551
@aadityapanchal8551 2 ай бұрын
great job
@lokeshborole8997
@lokeshborole8997 2 ай бұрын
Thanks🔥🔥
@neoh1471
@neoh1471 Жыл бұрын
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
@parshchoradia9909
@parshchoradia9909 Жыл бұрын
Understood Sir!
@torishi82
@torishi82 23 күн бұрын
Samaj aa gaya!!
@user-uv5or5bm2c
@user-uv5or5bm2c 6 ай бұрын
Understood.
@GhostVaibhav
@GhostVaibhav Жыл бұрын
Understood🔥
@AbhishekKumar-cv1dh
@AbhishekKumar-cv1dh Жыл бұрын
Understood 🔥🌪
@pratyushtripathi1728
@pratyushtripathi1728 8 ай бұрын
Understood 😊
@user-tk2vg5jt3l
@user-tk2vg5jt3l 6 ай бұрын
Thank you Bhaiya
@shubhammeena2316
@shubhammeena2316 9 ай бұрын
thank you so much bhaiya
@lakshmiprasanna7058
@lakshmiprasanna7058 Жыл бұрын
Understood 💯💯💯
@khalasianiket816
@khalasianiket816 8 күн бұрын
understood❤
@inspiringzone12
@inspiringzone12 Жыл бұрын
Great 👏👏
@abhay9994
@abhay9994 9 ай бұрын
Thank you
@YourCodeVerse
@YourCodeVerse 9 ай бұрын
Understood✅🔥🔥
@learnwithayush7838
@learnwithayush7838 Жыл бұрын
Understood brother
@user-is6ky7pp2n
@user-is6ky7pp2n 2 ай бұрын
Understood !! 😍😍
@kumpatisupriya3947
@kumpatisupriya3947 4 ай бұрын
Awesome 🤩🤩
@vidhishiste8751
@vidhishiste8751 11 ай бұрын
Understood ✨
@PSMADHURIHSIIPCMCREG
@PSMADHURIHSIIPCMCREG 20 күн бұрын
understood👍
@pravinthakur7791
@pravinthakur7791 6 ай бұрын
Understood 🔥🔥🔥
@aayushparsu3303
@aayushparsu3303 Жыл бұрын
Understood 👍🏻👍🏻👍🏻
@pulkitgupta669
@pulkitgupta669 11 ай бұрын
Understood ❤❤
@varunpalsingh3822
@varunpalsingh3822 Жыл бұрын
understood 👍👍
@her_soulmate
@her_soulmate 11 ай бұрын
Understood 🎉
@shino505
@shino505 Жыл бұрын
Understood!
@PankajSingh-pb4vs
@PankajSingh-pb4vs 5 ай бұрын
Understood ❤
@ayeshafathima614
@ayeshafathima614 8 ай бұрын
understood 👍
@gagankaushik556
@gagankaushik556 20 күн бұрын
thnx
@TanyaTa-ex6mk
@TanyaTa-ex6mk 10 ай бұрын
Thankyou dada🙏🏻🙏🏻🧡
@anantsingh2004
@anantsingh2004 Жыл бұрын
Understood !!
@user-nk1mb5fy7j
@user-nk1mb5fy7j Жыл бұрын
UNDERSTOOD
@dineshsuthar2631
@dineshsuthar2631 Жыл бұрын
Understood 😀
Count Subarray sum Equals K | Brute - Better -Optimal
24:09
take U forward
Рет қаралды 256 М.
Rotate Matrix/Image by 90 Degrees | Brute - Optimal
17:47
take U forward
Рет қаралды 189 М.
Jumping off balcony pulls her tooth! 🫣🦷
01:00
Justin Flom
Рет қаралды 28 МЛН
IQ Level: 10000
00:10
Younes Zarou
Рет қаралды 12 МЛН
哈莉奎因以为小丑不爱她了#joker #cosplay #Harriet Quinn
00:22
佐助与鸣人
Рет қаралды 8 МЛН
EVOLUTION OF ICE CREAM 😱 #shorts
00:11
Savage Vlogs
Рет қаралды 12 МЛН
The Last Algorithms Course You'll Need by ThePrimeagen | Preview
16:44
Frontend Masters
Рет қаралды 313 М.
Valorant, But it's +1000000 Aura Crosshair...
8:01
Shlappy
Рет қаралды 100
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 405 М.
Pascal Triangle | Finding nCr in minimal time
26:45
take U forward
Рет қаралды 213 М.
Trick for spiral matrix traversal
10:12
Techdose
Рет қаралды 200 М.
3 Sum | Brute -  Better - Optimal with Codes
38:25
take U forward
Рет қаралды 270 М.
Jumping off balcony pulls her tooth! 🫣🦷
01:00
Justin Flom
Рет қаралды 28 МЛН