#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.....
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.
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.
@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
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
Simulation approach is more intuitive and clean if you uderstand direction co-ordinate. Direction co-ordinate help you solve many other matrix problems easily.
#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.....
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 🫡
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.
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.
Nuvvu thopu guru, awesome
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
So well explained! Understood every bit of it!
What a super clean implementation dude! hats off!
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...
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
Thank You Striver Bhaiya !
Your playlist is really helping me a lot :)
Really this is a better to paid course
Thank you striver bhiya
Unbelievable Explanation!!
You are from which college bro...
@@mdfaizanmdfaizan6041 TINT, Kolkata
thank you for providing best content for us.
we really love it.
Java Solution : th-cam.com/video/cMHzWhBUON4/w-d-xo.html
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.
UNDERSTOOD!!!!
HAPPY FRIENDSHIP DAY STRIVER
You are from which college bro...
You are from which college bro...
I2IT
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
great explanation as always!! really clear!! Please continue making these videos.
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..
Very good explaination!! Thanks Striver.
Understood! Wonderful explanation as always, thank you very very much for your effort!!
Understood ❤ I do it by two different technique. Approach is same but condition is different
You are from which college bro...
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?
amazing approach!
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.
Whenever I see you I got inspired ❤
understood ,thnx for excellent explanation ❤❤❤❤❤❤
providing these well structured series by you feeling like that giving water to tree thnx by core of heart.
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 🙌🙌
Bhai U are an Inspiration kasam se Career wise!
watch in 1.25 is a myth
true that
wdym? im watching all his videos in 1.5x
UNDERSTOOD as always!
Thank you striver for great content!!
Please add videos related to strings as soon as possible.
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
this was good, thank you bhrata :)
great explanation!
Understood Bhaiya!
unbelievable explanation!!
Great explanation as usual. Thank you.
Thank you bhaiya, understood
Understood..Very clean explanation!
Another Awesome Lecture Sir............
thanks striver understood everything
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__ 🙌
Nice explanation!
understood! amazing explanation!!
Understood at one go Thank You Striver
Sir Thanks a lot for the excellent explanation 😁
Understood 🙏🏻
lovedd the intuition
Thank you bro. understood clearly.
Understood,Thanks striver for this amazing video.
Understood.
thank you soo much brother for the wonderful explanation
its amazing 🤩😻
Samaj aa gaya!!
Great Explanation
Understood amazing explanation as always❤❤
Understood! Awesome explanation.
understood❤
Understood 😊
wonderful explanation
you are amazing sir huge respect ...
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
Understood, Great explanation.
The way you explain
Understood
Understood. Thanks a lot
understood bhaiii
Best approach
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
thanks bhaiya
understood bhaiya
Thank you sir❤
Ericsson ???
Understood thanks 👍🙏
understanding
understood
Understood🔥
Thankyou dada🙏🏻🙏🏻🧡
understood sir thanks a lot
great job
I was able to solve this by myself but used one pointer only, this is very easy than my code lmao
just amazing !!
Thanks bro !!
Understood !! 😍😍
If there is already a while loop that says top
Understood ❤🔥❤🔥
Thank You Bhaiya 😊
thank you so much bhaiya
Thank you Bhaiya
Growing day by day in dsa
Striver is amazing
Is there any way so that i can like this video more than 1 time ❤❤