摘要: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p 阅读全文
posted @ 2016-09-02 20:02 googlemeoften 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. 阅读全文
posted @ 2016-09-02 17:29 googlemeoften 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 大概题意是这样的 输入一个数字,顺时针生成一个N阶的矩阵 比如:输入数字为: 3 生成矩阵为: 1 2 3 8 9 4 7 6 5 解题思路:我们考虑一圈一圈的生成矩阵,先生成最外面的一圈,然后生成第二圈。。。。 生成矩阵的时候我们要考虑边界的问题,通过矩阵的对角线的两个端点,因为矩阵是一个N x 阅读全文
posted @ 2016-09-02 16:23 googlemeoften 阅读(299) 评论(0) 推荐(0) 编辑
摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2016-09-02 16:12 googlemeoften 阅读(130) 评论(0) 推荐(0) 编辑