摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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, 阅读全文
摘要:
1:题目描述 Given an integer n, generate the nth term of the count-and-say sequence. 找规律,给定一个数n后,写出第n行的字符串 2:题目分析 突然发现自己的Say实在不发达,看了半个多小时才知道咋回事。n就是再说n-1行的内 阅读全文
摘要:
1:题目描述 Write a function to find the longest common prefix string amongst an array of strings. 找出字符串数组中最长的公共前缀 2:题目分析 先设定第一个字符串为最长前缀,依次向后比较,将‘最长前缀’一点点截 阅读全文
摘要:
1:题目描述 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close 阅读全文
摘要:
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): """ : 阅读全文
摘要:
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 阅读全文