上一页 1 ··· 3 4 5 6 7
摘要: 1.题目描述 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 阅读全文
posted @ 2018-02-04 19:43 vlice 阅读(97) 评论(0) 推荐(0)
摘要: 1.题目描述 mplement int sqrt(int x). Compute and return the square root of x. x is guaranteed to be a non-negative integer. 求开方,输出为整数型 2.题目分析 python自带sqrt 阅读全文
posted @ 2018-02-03 21:41 vlice 阅读(111) 评论(0) 推荐(0)
摘要: 1:题目描述 Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3, 阅读全文
posted @ 2018-02-03 16:14 vlice 阅读(99) 评论(0) 推荐(0)
摘要: 1:题目描述 将罗马数字转为十进制阿拉伯数字 2:题目分析 ①Ⅰ(1)、X(10)、C(100)、M(1000)、V(5)、L(50)、D(500) ②罗马数字中表示最大值的字母左侧数字为负,右侧为正 ③表示负数的字母最多重复一次 3:解体过程 4:解题感悟 发现负值不重复后代码就简洁很多了,想想自 阅读全文
posted @ 2018-02-02 21:43 vlice 阅读(146) 评论(0) 推荐(0)
摘要: 1:题目描述 Given an integer n, generate the nth term of the count-and-say sequence. 找规律,给定一个数n后,写出第n行的字符串 2:题目分析 突然发现自己的Say实在不发达,看了半个多小时才知道咋回事。n就是再说n-1行的内 阅读全文
posted @ 2018-02-02 21:27 vlice 阅读(186) 评论(0) 推荐(0)
摘要: 1:题目描述 Write a function to find the longest common prefix string amongst an array of strings. 找出字符串数组中最长的公共前缀 2:题目分析 先设定第一个字符串为最长前缀,依次向后比较,将‘最长前缀’一点点截 阅读全文
posted @ 2018-02-01 17:48 vlice 阅读(122) 评论(0) 推荐(0)
摘要: 1:题目描述 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close 阅读全文
posted @ 2018-02-01 09:46 vlice 阅读(95) 评论(0) 推荐(0)
摘要: 1:题目描述 Given a 32-bit signed integer, reverse digits of an integer 逆序输出数字,范围-2**31~2**32-1 2:解题思路( class Solution(object): def reverse(self, x): """ : 阅读全文
posted @ 2018-01-31 23:23 vlice 阅读(82) 评论(0) 推荐(0)
摘要: 1:题目描述 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would 阅读全文
posted @ 2018-01-31 23:12 vlice 阅读(147) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7