#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.....
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.
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 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
Simulation approach is more intuitive and clean if you uderstand direction co-ordinate. Direction co-ordinate help you solve many other matrix problems easily.
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
#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.....
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.
This course is really worth more than any course but still it is free.Thank you so much.
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.
Yes I will be going at my pace, don't want to compromise on quality.
thank you @@takeUforward
@@takeUforwardthank you so much bro❤
True that in 2024 still can't find a better DSA course than this 🫡
Understood.
The height of this series is you knowing how the code will be after the dry run..
Thank you Striver
True
you are providing such an amazing content at free of cost really india needs man like you !🤠
Finally was able to solve this problem with 100% understanding! Thanks a lot.
So well explained! Understood every bit of it!
Saw several videos on this question. This was the perfect and the easiest one. Hats off to you bhaiya. Thanks for such quality content :)
@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
Thanks
Thank You Striver Bhaiya !
Your playlist is really helping me a lot :)
watch in 1.25 is a myth
true that
wdym? im watching all his videos in 1.5x
@@Try_me_yes and you also you don’t understand 😂
What a super clean implementation dude! hats off!
Simulation approach is more intuitive and clean if you uderstand direction co-ordinate. Direction co-ordinate help you solve many other matrix problems easily.
Bro, wdym by simulation approach?
Really this is a better to paid course
Thank you striver bhiya
Bhai U are an Inspiration kasam se Career wise!
great content...
i know it will be very difficult for you but we need more videos as soon as possible
we don't need like this...we need quality...take your own time striver...
thank you for providing best content for us.
we really love it.
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.
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 🙌🙌
UNDERSTOOD!!!!
HAPPY FRIENDSHIP DAY STRIVER
You are from which college bro...
You are from which college bro...
I2IT
@@atharva_g_vlogs brother what is the need to apply this case , if( left
edge cases are mat[m][1] and mat[1][n], because of which 2 checks are needed
thanks i was not getting sense of if(left
Very good explaination!! Thanks Striver.
great explanation as always!! really clear!! Please continue making these videos.
Understood! Wonderful explanation as always, thank you very very much for your effort!!
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
Understood ❤ I do it by two different technique. Approach is same but condition is different
You are from which college bro...
Nuvvu thopu guru, awesome
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..
Unbelievable Explanation!!
You are from which college bro...
@@mdfaizanmdfaizan6041 TINT, Kolkata
This is one of the hardest questions I have come across in a while
And u r also looking hard.😊
@@ce038_divanshsingh3 chill bro wth u saying
amazing approach!
providing these well structured series by you feeling like that giving water to tree thnx by core of heart.
Whenever I see you I got inspired ❤
this was good, thank you bhrata :)
Thank you striver for great content!!
understood ,thnx for excellent explanation ❤❤❤❤❤❤
UNDERSTOOD as always!
Great video and explanation, you're awesome man, thank you!
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.
Understood..Very clean explanation!
unbelievable explanation!!
If there is already a while loop that says top
Great explanation as usual. Thank you.
Understood at one go Thank You Striver
Thank you bhaiya, understood
Understood Bhaiya!
Another Awesome Lecture Sir............
thanks striver understood everything
understood! amazing explanation!!
lovedd the intuition
Understood,Thanks striver for this amazing video.
Thank you bro. understood clearly.
Understood amazing explanation as always❤❤
Understood! Awesome explanation.
you are amazing sir huge respect ...
Sir Thanks a lot for the excellent explanation 😁
thank you soo much brother for the wonderful explanation
Please add videos related to strings as soon as possible.
great explanation!
Samaj aa gaya!!
Understood 🙏🏻
Understood
I have been waiting for this video from Striver anna
❤️ U Anna
Itne aasan se bataya ki aadha dekhke hi pura pta chal gya
its amazing 🤩😻
I was able to solve this by myself but used one pointer only, this is very easy than my code lmao
The way you explain
wonderful explanation
Understood, Great explanation.
Nice explanation!
Great Explanation
Thankyou dada🙏🏻🙏🏻🧡
if (top = left; i--) {
l.add(matrix[bottom][i]);
}
bottom--;
}
if (left = top; i--) {
l.add(matrix[i][left]);
}
left++;
}
for not repeating value already added
understood❤
Understood🔥
Thank you sir❤
Ericsson ???
Sir please , upload videos as fast as possible. 📤📤📤🕔🕔🕔
No more time remaining for our placement
Are bro, wo bhi toh insan ha ek saath kitna kaam krega
bhai sath me dp series ya graph ya tree series padh sakta hai it also help for your upcoming placements
bro tum wait karoge to nhi hoga khud se karne ka try karo. ek banda akele kitna hi kar lega
@@aman_singh__ 🙌
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
Best approach
Thank You Bhaiya 😊
Understood !! 😍😍
thankyou sir love you so much 🥰
Understood. Thanks a lot
Thank you thats all I can say!!!!
Understood ❤🔥❤🔥
Understood thanks 👍🙏
Understood✅🔥🔥
thanks bhaiya
understood sir thanks a lot
understood bhaiya
Understood 👍🏻👍🏻👍🏻
thank you so much bhaiya
Thank you Bhaiya
Understood ✨
Right Code in Python :
def spiralMatrix(matrix,r,c):
top = 0
left = 0
right = c-1
bottom = r-1
ans = []
while(left
Understood 🎉
Understood 💯💯💯
Striver is amazing
Growing day by day in dsa
Awesome 🤩🤩