File: root - text - article - 2019 - 11 - ways-to-traverse-a-grid.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, | English | Home Page | Category: Computing | 554 Views, 20981 Search Bots | 80 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, | English | Home Page | Category: Computing | 554 Views, 20981 Search Bots | 80 Words
| Browse | Archive
Hi, here's your problem today. This problem was recently asked by Microsoft:
You 2 integers n and m representing an n by m grid, determine the number of ways you can get from the top-left to the bottom-right of the matrix y going only right or down.
Example:
n = 2, m = 2
This should return 2, since the only possible routes are:
Right, down
Down, right.
Here's the signature:
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, | English | Home Page | Cateogry: Computing | 554 Views, 20981 Search Bots | 80 Words You 2 integers n and m representing an n by m grid, determine the number of ways you can get from the top-left to the bottom-right of the matrix y going only right or down.
Example:
n = 2, m = 2
This should return 2, since the only possible routes are:
Right, down
Down, right.
Here's the signature:
def num_ways(n, m):
# Fill this in.
print num_ways(2, 2)
# 2
Related Articles
- New Vulnerabilities (CVE-2016-4581) have been detected in CentOS/RHEL/CloudLinux 7
- Daily Interview Problem: Distribute Bonuses
- Reverse a Directed Graph
- Daily Interview Problem: Reverse Words in a String
- [Daily Problem] Witness of The Tall People
- Daily Interview Problem: Room scheduling
- Daily Interview Problem: Validate Binary Search Tree
- Palindrome Integers
- [Daily Problem] Angles of a Clock
- Compare Version Numbers
©2006~2024 SteakOverCooked - 0.01056 Seconds(s) - 1881.547 KB/s - 35 Online Memory: 493.13 KB
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
How to Cook a Perfect Steak? | <meta name="robots" content="index, follow">
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
Comments (0)
Read & Write - Normal - Mini - Post - All Comments - Statistics
Be the first one to comment this page !