Spiral Traversal of a Matrix | Spiral Matrix

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

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.....
@maccode07
@maccode07 2 күн бұрын
UNDERSTOOD!!!! HAPPY FRIENDSHIP DAY STRIVER
@enzaki7603
@enzaki7603 15 күн бұрын
Thank You Striver Bhaiya ! Your playlist is really helping me a lot :)
@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❤
@juliechoudhary9582
@juliechoudhary9582 Жыл бұрын
This course is really worth more than any course but still it is free.Thank you so much.
@yashkhatri3636
@yashkhatri3636 Жыл бұрын
you are providing such an amazing content at free of cost really india needs man like you !🤠
@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.
@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
@ruchirtd1
@ruchirtd1 Жыл бұрын
Finally was able to solve this problem with 100% understanding! Thanks a lot.
@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.
@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 :)
@shreeyarao8265
@shreeyarao8265 7 ай бұрын
So well explained! Understood every bit of it!
@tonylee1868
@tonylee1868 Жыл бұрын
great content... i know it will be very difficult for you but we need more videos as soon as possible
@indroneelgoswami5654
@indroneelgoswami5654 2 күн бұрын
Unbelievable Explanation!!
@rishabh1S
@rishabh1S Жыл бұрын
Very good explaination!! Thanks Striver.
@bhagyashreekhairnar683
@bhagyashreekhairnar683 6 ай бұрын
great explanation as always!! really clear!! Please continue making these videos.
@Ri-hg6hs
@Ri-hg6hs Жыл бұрын
providing these well structured series by you feeling like that giving water to tree thnx by core of heart.
@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 🙌🙌
@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.
@NazeerBashaShaik
@NazeerBashaShaik 7 ай бұрын
Great explanation as usual. Thank you.
@suraj_patwa
@suraj_patwa Жыл бұрын
Really this is a better to paid course Thank you striver bhiya
@sayakghosh5104
@sayakghosh5104 Жыл бұрын
Understood! Awesome explanation.
@Manishgupta200
@Manishgupta200 Жыл бұрын
Understood ❤ I do it by two different technique. Approach is same but condition is different
@milindjarsaniya
@milindjarsaniya 9 ай бұрын
UNDERSTOOD as always!
@amankumarverma8426
@amankumarverma8426 11 күн бұрын
amazing approach!
@priyachauhan813
@priyachauhan813 Жыл бұрын
Understood at one go Thank You Striver
@diyaghosh3721
@diyaghosh3721 Ай бұрын
understood! amazing explanation!!
@abhishek__anand__
@abhishek__anand__ Жыл бұрын
Great Explanation
@MMirabel
@MMirabel 9 ай бұрын
Understood..Very clean explanation!
@raynwani137
@raynwani137 7 ай бұрын
Bhai U are an Inspiration kasam se Career wise!
@p4avinash
@p4avinash Жыл бұрын
Understood, Great explanation.
@shristipurusarthi6675
@shristipurusarthi6675 10 ай бұрын
thank you soo much brother for the wonderful 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.
@ishangujarathi10
@ishangujarathi10 Жыл бұрын
lovedd the intuition
@tarushidubey2973
@tarushidubey2973 Жыл бұрын
you are amazing sir huge respect ...
@VineetKumar-fk2rl
@VineetKumar-fk2rl 9 ай бұрын
Understood amazing explanation as always❤❤
@AniketKumar-hf2bo
@AniketKumar-hf2bo 6 ай бұрын
understood ,thnx for excellent explanation ❤❤❤❤❤❤
@Sumeet_100
@Sumeet_100 Жыл бұрын
just amazing !!
@hareshnayak7302
@hareshnayak7302 4 ай бұрын
Understood,Thanks striver for this amazing video.
@ProgrammingKT
@ProgrammingKT 6 ай бұрын
Nice explanation!
@priyankavasam8769
@priyankavasam8769 Жыл бұрын
wonderful explanation
@dinimeegada9167
@dinimeegada9167 Жыл бұрын
Understood I have been waiting for this video from Striver anna ❤️ U Anna
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars 10 ай бұрын
this was good, thank you bhrata :)
@sarangkumarsingh7901
@sarangkumarsingh7901 4 ай бұрын
Another Awesome Lecture Sir............
@konankikeerthi
@konankikeerthi 2 ай бұрын
Thank you bro. understood clearly.
@kingbadshah452
@kingbadshah452 6 ай бұрын
thanks striver understood everything
@samuelfrank1369
@samuelfrank1369 6 ай бұрын
Understood. Thanks a lot
@moharramansari2594
@moharramansari2594 Жыл бұрын
The way you explain
@quickknowledge1401
@quickknowledge1401 Жыл бұрын
Best approach
@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..
@reddygopichand2002
@reddygopichand2002 9 ай бұрын
Understood thanks 👍🙏
@lucario404
@lucario404 Жыл бұрын
edge cases are mat[m][1] and mat[1][n], because of which 2 checks are needed
@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?
@student_03
@student_03 10 ай бұрын
understood sir thanks a lot
@aadityapanchal8551
@aadityapanchal8551 2 ай бұрын
great job
@NitinKumar-wm2dg
@NitinKumar-wm2dg Жыл бұрын
Thank you bhaiya, understood
@debasishbhol777
@debasishbhol777 26 күн бұрын
Thanks bro !!
@computerscience68
@computerscience68 Жыл бұрын
Thank You Bhaiya 😊
@inspiringzone12
@inspiringzone12 Жыл бұрын
Great 👏👏
@charan123rams3
@charan123rams3 Жыл бұрын
thankyou sir love you so much 🥰
@infernogamer52
@infernogamer52 Жыл бұрын
Understood Bhaiya!
@parshchoradia9909
@parshchoradia9909 Жыл бұрын
Understood Sir!
@AbhishekKumar-cv1dh
@AbhishekKumar-cv1dh Жыл бұрын
Understood 🔥🌪
@kumpatisupriya3947
@kumpatisupriya3947 4 ай бұрын
Awesome 🤩🤩
@GhostVaibhav
@GhostVaibhav Жыл бұрын
Understood🔥
@lokeshborole8997
@lokeshborole8997 2 ай бұрын
Thanks🔥🔥
@YourCodeVerse
@YourCodeVerse 9 ай бұрын
Understood✅🔥🔥
@ru_mum77
@ru_mum77 Ай бұрын
Sir Thanks a lot for the excellent explanation 😁
@harshilpatel3205
@harshilpatel3205 4 күн бұрын
Understood 🙏🏻
@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
@abhay9994
@abhay9994 9 ай бұрын
Thank you
@lakshmiprasanna7058
@lakshmiprasanna7058 Жыл бұрын
Understood 💯💯💯
@varunpalsingh3822
@varunpalsingh3822 Жыл бұрын
understood 👍👍
@learnwithayush7838
@learnwithayush7838 Жыл бұрын
Understood brother
@vidhishiste8751
@vidhishiste8751 11 ай бұрын
Understood ✨
@pulkitgupta669
@pulkitgupta669 11 ай бұрын
Understood ❤❤
@torishi82
@torishi82 23 күн бұрын
Samaj aa gaya!!
@pratyushtripathi1728
@pratyushtripathi1728 8 ай бұрын
Understood 😊
@pravinthakur7791
@pravinthakur7791 6 ай бұрын
Understood 🔥🔥🔥
@user-is6ky7pp2n
@user-is6ky7pp2n 2 ай бұрын
Understood !! 😍😍
@aayushparsu3303
@aayushparsu3303 Жыл бұрын
Understood 👍🏻👍🏻👍🏻
@user-tk2vg5jt3l
@user-tk2vg5jt3l 6 ай бұрын
Thank you Bhaiya
@falaknaaz789
@falaknaaz789 Жыл бұрын
Thank you sir❤
@Heartless-he8km
@Heartless-he8km Жыл бұрын
Ericsson ???
@TanyaTa-ex6mk
@TanyaTa-ex6mk 10 ай бұрын
Thankyou dada🙏🏻🙏🏻🧡
@dineshsuthar2631
@dineshsuthar2631 Жыл бұрын
Understood 😀
@khalasianiket816
@khalasianiket816 8 күн бұрын
understood❤
@shubhammeena2316
@shubhammeena2316 9 ай бұрын
thank you so much bhaiya
@PankajSingh-pb4vs
@PankajSingh-pb4vs 5 ай бұрын
Understood ❤
@ayeshafathima614
@ayeshafathima614 8 ай бұрын
understood 👍
@her_soulmate
@her_soulmate 11 ай бұрын
Understood 🎉
@SibiRanganathL
@SibiRanganathL 6 ай бұрын
Understood.
@EUEESANJAYPRAKASHS
@EUEESANJAYPRAKASHS Жыл бұрын
Understood😊😊😊
@subham1rout
@subham1rout Жыл бұрын
Understood😍😍😍😍😍
@PSMADHURIHSIIPCMCREG
@PSMADHURIHSIIPCMCREG 20 күн бұрын
understood👍
@shino505
@shino505 Жыл бұрын
Understood!
@user-gx1cb3ni1r
@user-gx1cb3ni1r 8 ай бұрын
watch in 1.25 is a myth
@iAnuragJha
@iAnuragJha Ай бұрын
true that
@anantsingh2004
@anantsingh2004 Жыл бұрын
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 М.
Smart Sigma Kid #funny #sigma #memes
00:26
CRAZY GREAPA
Рет қаралды 7 МЛН
Ouch.. 🤕
00:30
Celine & Michiel
Рет қаралды 27 МЛН
Launching the best DSA Course + Platform
36:29
take U forward
Рет қаралды 6 М.
LeetCode Spiral Matrix Solution Explained - Java
11:07
Nick White
Рет қаралды 48 М.
Big-O Notation - For Coding Interviews
20:38
NeetCode
Рет қаралды 441 М.
Next Permutation - Intuition in Detail 🔥 | Brute to Optimal
28:15
take U forward
Рет қаралды 342 М.
L5. Next Greater Element | Stack and Queue Playlist
18:25
take U forward
Рет қаралды 9 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 405 М.
L6. Job Sequencing Problem | Greedy Algorithm Playlist
16:07
take U forward
Рет қаралды 19 М.
3 Sum | Brute -  Better - Optimal with Codes
38:25
take U forward
Рет қаралды 271 М.
Smart Sigma Kid #funny #sigma #memes
00:26
CRAZY GREAPA
Рет қаралды 7 МЛН