Spiral Traversal of a Matrix | Spiral Matrix

  Рет қаралды 211,621

take U forward

take U forward

Күн бұрын

Пікірлер: 292
@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 11 ай бұрын
thank you @@takeUforward
@gokulanvs
@gokulanvs 10 ай бұрын
​@@takeUforwardthank you so much bro❤
@Manoj_study
@Manoj_study Ай бұрын
True that in 2024 still can't find a better DSA course than this 🫡
@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
@AbhinayKrishna4
@AbhinayKrishna4 7 ай бұрын
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 Жыл бұрын
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 !🤠
@ruchirtd1
@ruchirtd1 Жыл бұрын
Finally was able to solve this problem with 100% understanding! Thanks a lot.
@maccode07
@maccode07 Ай бұрын
UNDERSTOOD!!!! HAPPY FRIENDSHIP DAY STRIVER
@mdfaizanmdfaizan6041
@mdfaizanmdfaizan6041 22 күн бұрын
You are from which college bro...
@mdfaizanmdfaizan6041
@mdfaizanmdfaizan6041 22 күн бұрын
You are from which college bro...
@maccode07
@maccode07 20 күн бұрын
I2IT
@indroneelgoswami5654
@indroneelgoswami5654 Ай бұрын
Unbelievable Explanation!!
@mdfaizanmdfaizan6041
@mdfaizanmdfaizan6041 22 күн бұрын
You are from which college bro...
@indroneelgoswami5654
@indroneelgoswami5654 22 күн бұрын
@@mdfaizanmdfaizan6041 TINT, Kolkata
@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 9 ай бұрын
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
@JK-de2gh
@JK-de2gh Ай бұрын
we don't need like this...we need quality...take your own time striver...
@enzaki7603
@enzaki7603 2 ай бұрын
Thank You Striver Bhaiya ! Your playlist is really helping me a lot :)
@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?
@shadowslayer2248
@shadowslayer2248 4 ай бұрын
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.
@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..
@cinime
@cinime Жыл бұрын
Understood! Wonderful explanation as always, thank you very very much for your effort!!
@KesavaReddyKuppireddygari
@KesavaReddyKuppireddygari 10 ай бұрын
watch in 1.25 is a myth
@iAnuragJha
@iAnuragJha 2 ай бұрын
true that
@Try_me_
@Try_me_ 19 күн бұрын
wdym? im watching all his videos in 1.5x
@lucario404
@lucario404 Жыл бұрын
edge cases are mat[m][1] and mat[1][n], because of which 2 checks are needed
@prathameshprabhu-ed8dl
@prathameshprabhu-ed8dl 28 күн бұрын
thanks i was not getting sense of if(left
@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
@mukeshKumar-go5cz
@mukeshKumar-go5cz Жыл бұрын
thank you for providing best content for us. we really love it.
@ImRich-xo8cm
@ImRich-xo8cm 11 күн бұрын
Whenever I see you I got inspired ❤
@suraj_patwa
@suraj_patwa Жыл бұрын
Really this is a better to paid course Thank you striver bhiya
@bhagyashreekhairnar683
@bhagyashreekhairnar683 8 ай бұрын
great explanation as always!! really clear!! Please continue making these videos.
@Manishgupta200
@Manishgupta200 Жыл бұрын
Understood ❤ I do it by two different technique. Approach is same but condition is different
@mdfaizanmdfaizan6041
@mdfaizanmdfaizan6041 22 күн бұрын
You are from which college bro...
@chinnadhodlekavitha6540
@chinnadhodlekavitha6540 2 ай бұрын
Please add videos related to strings as soon as possible.
@rishabh1S
@rishabh1S Жыл бұрын
Very good explaination!! Thanks Striver.
@indroneelgoswami5654
@indroneelgoswami5654 Ай бұрын
unbelievable explanation!!
@amankumarverma8426
@amankumarverma8426 Ай бұрын
amazing approach!
@SibiRanganathL
@SibiRanganathL 7 ай бұрын
Understood.
@hrushi_borhade
@hrushi_borhade Жыл бұрын
Thank you striver for great content!!
@harshilpatel3205
@harshilpatel3205 Ай бұрын
Understood 🙏🏻
@who__are___you____26__
@who__are___you____26__ 5 ай бұрын
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 🙌🙌
@rohandhalpe9084
@rohandhalpe9084 Жыл бұрын
Sir please , upload videos as fast as possible. 📤📤📤🕔🕔🕔 No more time remaining for our placement
@notcliche4864
@notcliche4864 Жыл бұрын
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__ 🙌
@Ri-hg6hs
@Ri-hg6hs Жыл бұрын
providing these well structured series by you feeling like that giving water to tree thnx by core of heart.
@milindjarsaniya
@milindjarsaniya 11 ай бұрын
UNDERSTOOD as always!
@AshishSingh-he2qo
@AshishSingh-he2qo 3 ай бұрын
Is there any way so that i can like this video more than 1 time ❤❤
@AniketKumar-hf2bo
@AniketKumar-hf2bo 7 ай бұрын
understood ,thnx for excellent explanation ❤❤❤❤❤❤
@NitinKumar-wm2dg
@NitinKumar-wm2dg Жыл бұрын
Thank you bhaiya, understood
@AmareshwarBhat800
@AmareshwarBhat800 5 ай бұрын
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.
@AjeyaKumaraK
@AjeyaKumaraK 3 ай бұрын
understanding
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars Жыл бұрын
this was good, thank you bhrata :)
@raynwani137
@raynwani137 8 ай бұрын
Bhai U are an Inspiration kasam se Career wise!
@hareshnayak7302
@hareshnayak7302 6 ай бұрын
Understood,Thanks striver for this amazing video.
@infernogamer52
@infernogamer52 Жыл бұрын
Understood Bhaiya!
@NazeerBashaShaik
@NazeerBashaShaik 8 ай бұрын
Great explanation as usual. Thank you.
@diyaghosh3721
@diyaghosh3721 2 ай бұрын
understood! amazing explanation!!
@ishangujarathi10
@ishangujarathi10 Жыл бұрын
lovedd the intuition
@MMirabel
@MMirabel 10 ай бұрын
Understood..Very clean explanation!
@arnavkumar4631
@arnavkumar4631 13 күн бұрын
Understood
@user-cq6en6rd4q
@user-cq6en6rd4q 5 ай бұрын
This is one of the hardest questions I have come across in a while
@ce038_divanshsingh3
@ce038_divanshsingh3 5 ай бұрын
And u r also looking hard.😊
@Yup728
@Yup728 3 ай бұрын
@@ce038_divanshsingh3 chill bro wth u saying
@khalasianiket816
@khalasianiket816 Ай бұрын
understood❤
@konankikeerthi
@konankikeerthi 3 ай бұрын
Thank you bro. understood clearly.
@Sachin-x4m7c
@Sachin-x4m7c 6 ай бұрын
I was able to solve this by myself but used one pointer only, this is very easy than my code lmao
@priyachauhan813
@priyachauhan813 Жыл бұрын
Understood at one go Thank You Striver
@AbhishekKumar-cd4gg
@AbhishekKumar-cd4gg 11 ай бұрын
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
@sayakghosh5104
@sayakghosh5104 Жыл бұрын
Understood! Awesome explanation.
@pratyushtripathi1728
@pratyushtripathi1728 10 ай бұрын
Understood 😊
@VineetKumar-fk2rl
@VineetKumar-fk2rl 10 ай бұрын
Understood amazing explanation as always❤❤
@moharramansari2594
@moharramansari2594 Жыл бұрын
The way you explain
@shristipurusarthi6675
@shristipurusarthi6675 11 ай бұрын
thank you soo much brother for the wonderful explanation
@kingbadshah452
@kingbadshah452 8 ай бұрын
thanks striver understood everything
@culeforever5408
@culeforever5408 11 ай бұрын
understood partially 🤔
@dinimeegada9167
@dinimeegada9167 Жыл бұрын
Understood I have been waiting for this video from Striver anna ❤️ U Anna
@sarangkumarsingh7901
@sarangkumarsingh7901 6 ай бұрын
Another Awesome Lecture Sir............
@tarushidubey2973
@tarushidubey2973 Жыл бұрын
you are amazing sir huge respect ...
@VarunGodiya
@VarunGodiya Жыл бұрын
please complete it as soon as possible .
@inspiringzone12
@inspiringzone12 Жыл бұрын
Quality is rare with speed
@NithinvKumar-uk2he
@NithinvKumar-uk2he Жыл бұрын
Yes please do complete fast it will be so much helpful for our upcoming placements please
@lakshsinghania
@lakshsinghania 4 ай бұрын
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
@ru_mum77
@ru_mum77 2 ай бұрын
Sir Thanks a lot for the excellent explanation 😁
@karanveersinghdeora5085
@karanveersinghdeora5085 Жыл бұрын
understood
@p4avinash
@p4avinash Жыл бұрын
Understood, Great explanation.
@gautamsaxena4647
@gautamsaxena4647 4 күн бұрын
understood bhaiya
@oyeesharme
@oyeesharme 5 күн бұрын
thanks bhaiya
@architmishra0057
@architmishra0057 Ай бұрын
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
@abhishek__anand__
@abhishek__anand__ Жыл бұрын
Great Explanation
@samuelfrank1369
@samuelfrank1369 7 ай бұрын
Understood. Thanks a lot
@sauravchandra10
@sauravchandra10 Жыл бұрын
Instead of checking several conditions multiple times, can we maintain a counter which tells us what to print? This the the implementation, and this code runs on both LC and CN int n=matrix.size(),m=matrix[0].size(); int top=0,left=0,right=m-1,bottom=n-1; int counter=0; vector temp; while(top
@23cash86
@23cash86 Жыл бұрын
Intersting
@placement123
@placement123 Жыл бұрын
@@23cash86 good catch buddy..
@ProgrammingKT
@ProgrammingKT 8 ай бұрын
Nice explanation!
@priyankavasam8769
@priyankavasam8769 Жыл бұрын
wonderful explanation
@falaknaaz789
@falaknaaz789 Жыл бұрын
Thank you sir❤
@Heartless-he8km
@Heartless-he8km Жыл бұрын
Ericsson ???
@SHAKTI2.O
@SHAKTI2.O Ай бұрын
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
@alheraahmad5481
@alheraahmad5481 25 күн бұрын
understood!
@DeadPoolx1712
@DeadPoolx1712 Ай бұрын
UNDERSTOOD;
@ysabhishekmishra
@ysabhishekmishra Жыл бұрын
class Solution { public: vectorans; int n,m; void dfs(int i,int j,vectormatrix,vector&visited){ if(i=n || j=m || visited[i][j]){ return; } visited[i][j]=1; ans.push_back(matrix[i][j]); if(i
@reddygopichand2002
@reddygopichand2002 10 ай бұрын
Understood thanks 👍🙏
@hariomatkar4689
@hariomatkar4689 Жыл бұрын
Itne aasan se bataya ki aadha dekhke hi pura pta chal gya
@Sumeet_100
@Sumeet_100 Жыл бұрын
just amazing !!
@GhostVaibhav
@GhostVaibhav Жыл бұрын
Understood🔥
@student_03
@student_03 Жыл бұрын
understood sir thanks a lot
@djpro6413
@djpro6413 Жыл бұрын
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
@star-yz3xv
@star-yz3xv 3 ай бұрын
If there is already a while loop that says top
@charan123rams3
@charan123rams3 Жыл бұрын
thankyou sir love you so much 🥰
@SYCOA12CHAITANYAASOLE
@SYCOA12CHAITANYAASOLE 3 ай бұрын
Understood !! 😍😍
@quickknowledge1401
@quickknowledge1401 Жыл бұрын
Best approach
@computerscience68
@computerscience68 Жыл бұрын
Thank You Bhaiya 😊
@torishi82
@torishi82 2 ай бұрын
Samaj aa gaya!!
@PSMADHURIHSIIPCMCREG
@PSMADHURIHSIIPCMCREG 2 ай бұрын
understood👍
@prabhagaikwad4849
@prabhagaikwad4849 Жыл бұрын
Understood!! This problem link is not updated in A2ZDSA course sheet. Thanks
@shubhammeena2316
@shubhammeena2316 10 ай бұрын
thank you so much bhaiya
@shreyasinha4016
@shreyasinha4016 9 ай бұрын
just a doubt while loop me condition h fir wapas q check kr rhe,? top bottom ki values tpo mana change ho rhi pr ek bar condition dalne ke bad dubara q dalte wo update nhi hoti values ke sath
@sushma6314
@sushma6314 7 ай бұрын
kyunki after first two for loops, top will be increased and right will be decreased. toh check karne ke liye ki while loop ka condition abhi bhi true hold hain ki nahi,
Count Subarray sum Equals K | Brute - Better -Optimal
24:09
take U forward
Рет қаралды 294 М.
Rotate Matrix/Image by 90 Degrees | Brute - Optimal
17:47
take U forward
Рет қаралды 218 М.
So Cute 🥰
00:17
dednahype
Рет қаралды 58 МЛН
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 19 МЛН
Girl, dig gently, or it will leak out soon.#funny #cute #comedy
00:17
Funny daughter's daily life
Рет қаралды 48 МЛН
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 42 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 524 М.
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 328 М.
Next Permutation - Intuition in Detail 🔥 | Brute to Optimal
28:15
take U forward
Рет қаралды 398 М.
Set Matrix Zeroes | O(1) Space Approach | Brute - Better - Optimal
30:07