LeetCode Rotate Array Solution Explained - Java

preview_player
Показать описание


Preparing For Your Coding Interviews? Use These Resources
————————————————————

Other Social Media
----------------------------------------------

Show Support
------------------------------------------------------------------------------

#coding #programming #softwareengineering
Рекомендации по теме
Комментарии
Автор

That was very important advice not to spend hours trying to crack something. Seen so many folks spending hours as if this is a life and death situation burn hours and barely solve a few problems in a month. Look at the solutions if you can't crack it, digest and move on. The more problems and patterns one can digest would help you solve some unseen problem on the interview.

shreejitnair
Автор

What you said about not stressing on problem for long is absolutely true Bruh !

aghavvikas
Автор

That is so true! I used to waste a lot of time on one single question but lesson learnt! I feel like I am getting better everyday. Thank you! :)

vm
Автор

Three years later, your comment just made me realize something i have been struggling with for 5 years.. I guess you can try for like 20 minutes, if you don't get it, look at the solution, understand it very well and you will remember the patterns without even trying. And by remembering the patterns, it means you can apply it to another problem. It is not a matter of life and death.. It comes from practice.. Hopefully, i will get there someday

samuelvalentine
Автор

Exactly! I used to spend an enormous amount of time on a single question, but I've grown from that. I truly feel like I'm becoming better with each passing day. Thank you for everything!

Rohan
Автор

I wish there was a resource available for learning these "tools" then another section devoted to practicing these tools building on your knowledge.

CCV
Автор

Thanks a lot for making this video Nick. I just marked it down - "If you are struggling with a problem more than 20 or 30 mins, you are wasting you time ." It's a lesson worth noting down. Thanks :)

sunnysrivastav
Автор

I spent two days on this problem before finding this video.

At the time, I was telling myself that if I skipped the struggle, I'd be missing out on a valuable learning experience. It was still fun, for a bit.

This is what I have learnt:

Sometimes, you can cheat yourself by _not_ looking at the solution.

Like others and yourself have said, the people who originally came up with these tricks may have worked for much longer or been lucky to spot them.

But more importantly, I think skipping to the solution can sometimes impart other useful lessons, such as that sometimes the answer is a trick, or that there's a radically different way of thinking about things. And that's valuable.

It's not like you just come away from reading a solution only knowing the solution. Sometimes it also imparts nuggets of insight and wisdom beyond the immediate answer to the problem.

dangereuxdave
Автор

Nick, you are such an inspiration! I spent nearly 2 hours figuring it out but in vain. What you said is absolutely right. It is ok to fail and look at the solution sometimes. We can't be correct always. Thank you so much :)

umabharati
Автор

you are my absolute favorite youtuber to watch while studying for tech interviews

ruthylevi
Автор

Bro I was trying to do this problem before looking at the solution for about hour and half and what you said at he beginning make since so much. Thank you.

alexshiferaw
Автор

Came for the explanation of the problem, but stayed for the advice! Thanks Nick!

ankit
Автор

I really needed to hear these words after this problem, I really felt down. Thanks Nick.

farizma
Автор

True I spent hours thinking, my ego always comes like I can solve this easy problem without taking any hint. We cannot spend time like this. We do not need to mug up this particular problem rather than we have to understand the concept which will help in solving any problems like this or we can use this concept where it can be useful. It's ok to take a bit of a hint to train our minds. Thank you Nick for your advice.

AbhinavKumar-dref
Автор

~The Much Needed advice~
*We just learn

People are always stressing about how you shouldn't look at the solution and try to solve it yourself, but no one gives this advice
we arent Einstein. Thanks Nick

savvy
Автор

You're right. The answer is always so easy to understand! And I always feel myself as a total dumbass for not solving it myself 😂

jamesmiller
Автор

I agree with ya. It's sad on the state of things. Basically instead of working for your employer doing real work, people are secretly burning themselves out to memorize these 'tricks' to go for that next employer. And go in to an interview for a lottery and hope that it's a 'trick' you have memorized and applicable to the problem of the day. It's basically a lose-lose situation. As a current employer you lose, and as an employee seeking mobility you lose. Your future employer feels smug putting you through the ringer, until secretly productive drops to nothing because their current employee is also wasting his/her life studying and memorizing tricks. It's a vicious cycle.

It'd make too much sense if prospective employers actually look for skills that you'd build up in an actual day to day job. The skills that'd actually help them in their business day to day. Nope, makes way too much sense. Can't do.

I have used BFS/DFS Zero times in my career as both 9 years of C Firmware Engineer and 4 years of iOS engineer. The concept itself can be picked up when needed in 10 minutes. And does not need trick questions to proof understanding. Yet people and grilled for perfection in applying them to all sorts of 'trick' questions. What for?

biscottigelato
Автор

Thanks man, this video did change my outlook on how to solve problems in general.

divyanshuchaudhari
Автор

My left ear understood the solution really well. Thank you!

amogh_wagh
Автор

Thnks nick, you are an inspiration to overcome my fear from DS & Algo ...Awesome

hackernight