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 | 568 Views, 22779 Search Bots | 80 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, | English | Home Page | Category: Computing | 568 Views, 22779 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 | 568 Views, 22779 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
- Progess made
- Daily Interview Problem: Minimum Removals for Valid Parenthesis
- Daily Interview Problem: Circle of Chained Words
- Daily Interview Puzzle: Ways to Traverse a Grid
- Daily Interview Problem: Look and Say Sequence
- Daily Interview Question: Word Search
- Algorithm Interview Question: Symmetric k-ary Tree
- Fix Brackets
- Daily Interview Problem: Contiguous Subarray with Maximum Sum
- Daily Interview Puzzle: Falling Dominoes
©2006~2024 SteakOverCooked - 0.00845 Seconds(s) - 2255.224 KB/s - 11 Online Memory: 492.67 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="noindex, 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 !