Problem 80: Unique Paths[Google]
Grid traversal, Dynamic Programming ,Recursion
Hey, it’s your favorite cult leader here 🐱👤
On Wednesdays, I will send you a hand-picked problem for you to solve. The solutions will be sent on the following day. Use the weekly problems as a guide way to get some consistency in your life.
To get access to all my articles and support my crippling chocolate milk addiction, consider subscribing if you haven’t already!
p.s. you can learn more about the paid plan here.
We are nearing the end of the useful Leetcode questions to cover.
Hope you’re excited.
Since DP seems to be a problem for many, thought I’d throw more of these to finish up.
This question can be found as Leetcode 62. Unique Paths.
There is a robot on an
m x n grid. The robot is initially located at the top-left corner (i.e.,
grid). The robot tries to move to the bottom-right corner (i.e.,
grid[m - 1][n - 1]). The robot can only move either down or right at any point in time.
Given the two integers
n, return the number of possible unique paths that the robot can take to reach the bottom-right corner.
The test cases are generated so that the answer will be less than or equal to
2 * 109.
Input: m = 3, n = 7 Output: 28
Input: m = 3, n = 2 Output: 3 Explanation: From the top-left corner, there are a total of 3 ways to reach the bottom-right corner: 1. Right -> Down -> Down 2. Down -> Down -> Right 3. Down -> Right -> Down
1 <= m, n <= 100
You can test your solution here
Before you leave, there is one final thing I would like to talk about. As you may know, I’m a university student, about to graduate in May of this year. After graduation, I will be looking for work. If you have any leads, I would really appreciate introductions. My resume is here and you can find my LinkedIn profile here. Being a startup, the company I’m with currently can’t provide Visa Sponsorship (same for most of the recruiters that reach out to me through LinkedIn). Any help in this matter would be greatly appreciated.
That is it for this piece. I appreciate your time. As always, if you’re interested in working with me or checking out my other work, my links will be at the end of this email/post. If you like my writing, I would really appreciate an anonymous testimonial. You can drop it here. And if you found value in this write-up, I would appreciate you sharing it with more people.
Upgrade your tech career with my newsletter ‘Tech Made Simple’! Stay ahead of the curve in AI, software engineering, and tech industry with expert insights, tips, and resources. 20% off for new subscribers by clicking this link. Subscribe now and simplify your tech journey!
Using this discount will drop the prices-
800 INR (10 USD) → 533 INR (8 USD) per Month
8000 INR (100 USD) → 6400INR (80 USD) per year
Reach out to me
Use the links below to check out my other content, learn more about tutoring, reach out to me about projects, or just to say hi.
Small Snippets about Tech, AI and Machine Learning over here
If you like my writing, I would really appreciate an anonymous testimonial. You can drop it here.
To help me understand you fill out this survey (anonymous)
Check out my other articles on Medium. : https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
Reach out to me on LinkedIn. Let’s connect: https://rb.gy/m5ok2y
My Instagram: https://rb.gy/gmvuy9
My Twitter: https://twitter.com/Machine01776819