To the Top
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 | 292 Views, 15367 Search Bots | 80 Words

Subscribe to Feed Burner | 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:


def num_ways(n, m):
# Fill this in.

print num_ways(2, 2)
# 2
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, | English | Home Page | Cateogry: Computing | 292 Views, 15367 Search Bots | 80 Words Subscribe to Feed Burner

Related Articles

  1. Skip the readings, focus on problems. And use all the hints!
  2. Daily Interview Problem: Distribute Bonuses
  3. Daily Interview Problem: Reverse Words in a String
  4. First and Last Indices of an Element in a Sorted Array
  5. Plus One
  6. Daily Interview Problem: Largest Product of 3 Elements I
  7. Linode Support Ticket 10029540 - Other - Important Notice Regarding Ubuntu 17.10 Image
  8. Daily Interview Problem: Validate Binary Search Tree
  9. Sort a Partially Sorted List
  10. Algorithm Interview Question: H-Index

Comments (0)

    Be the first one to comment this page !


Page Edited: May 11 2024 14:36:49 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="index, follow">