上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16,...) which sum to n. For example, given n = 12 , 阅读全文
posted @ 2016-09-07 13:53 googlemeoften 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 题目:输入一个整数数字,输出该数字的中文拼音 比如:54 wushisi 100 yibai 6006 liuqianlingliu 60006 liuwanlingliu 解题思路: 首先要把数字的读音和数字对应起来,十位、百位、千位。。。等等的读音对应起来 接下来要考虑到几种情况: 1、各位为零 阅读全文
posted @ 2016-09-07 10:21 googlemeoften 阅读(849) 评论(0) 推荐(0) 编辑
摘要: 输入一个数字n,顺时针生成一个n阶矩阵。 比如输入n = 5,生成矩阵如下 1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 8 该题只要考虑比较好的办法是从外到内一圈一圈的打印,就如下图所示: 在按圈进行生成的时候需要考虑到两个坐标和截至条件,左上角(t 阅读全文
posted @ 2016-09-05 16:57 googlemeoften 阅读(261) 评论(0) 推荐(0) 编辑
摘要: Given three strings: s1, s2, s3, determine whether s3 is formed by the interleaving of s1 and s2. Example For s1 = "aabcc", s2 = "dbbca" When s3 = "aa 阅读全文
posted @ 2016-09-03 21:17 googlemeoften 阅读(201) 评论(0) 推荐(0) 编辑
摘要: There are n coins in a line. Two players take turns to take one or two coins from right side until there are no more coins left. The player who take t 阅读全文
posted @ 2016-09-03 20:21 googlemeoften 阅读(332) 评论(0) 推荐(0) 编辑
摘要: Given n items with size Ai, an integer m denotes the size of a backpack. How full you can fill this backpack? Example If we have 4 items with size [2, 阅读全文
posted @ 2016-09-03 11:03 googlemeoften 阅读(1162) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页