Your explanation is really good, dunno why you have this less viewers, keep it up!
@CanYouDodgeThis2 жыл бұрын
The scale down trick is what I was missing. My solution was gross. Thanks for sharing.
@TheFrogfather12 жыл бұрын
Congratulations on getting into the top 100! I'm around position 17,000 😳
@marcusaberg2 жыл бұрын
I think it was really hard to parse based on the text in the task how the tail was actually moving . Impressed how you could get that that quickly and adapt your code. In the end I went for some array subtraction shit that i had to think through a lot before getting it right. If I would have understood that normalizing the difference between the head and the tail woud give me the move direction it would have made it a lot simpler :) like you did in the matter of minutes :)
@WilliamYFeng2 жыл бұрын
Thanks! Yeah, finding that normalization technique was really a stroke of inspiration and drastically reduced the amount of casework I had to do.
@dawizze12 жыл бұрын
Out of curiosity. What do you do to practice? Or get better at solving these types of problems? Do you just do a shit ton of LeetCode or something else? lol Curious because I notice you and others seem to have a patterned approach. Meaning you're able to quickly see what category this type of problem falls into and what kind of approaches, data structures, etc. are useful to solve this type of problem.
@WilliamYFeng2 жыл бұрын
Hey there! I did a bunch of LeetCode contests two years ago, and made videos explaining my solutions to the problems. Here's a playlist with all of them: kzbin.info/aero/PLsqh-jhhTL2-1J8o1_yWdjzmSIdWZ2swb Doing those contests was one of the primary things that boosted my problem-solving skills, as well as my ability to implement solutions quickly. I'd definitely recommend doing more of that practice.