- 博客(12)
- 收藏
- 关注
原创 杨辉三角之二
一、题目 英文:Plus One 中文:杨辉三角之二 二、内容要求 英文:Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you optimize your algorithm to use
2017-08-06 21:51:46
496
转载 java 键盘输入多种方法
一、Java不像C中拥有scanf这样功能强大的函数,大多是通过定义输入输出流对象。常用的类有BufferedReader,Scanner。 实例程序: 1、利用 Scanner 实现从键盘读入integer或float 型数据 import java.io.*; import java.util.*; public class InputTest{ public stati
2017-08-06 18:12:56
536
原创 Java键盘输入方式总结
一、输入的要求是:从键盘的输入,由用户确定数组大小,并接受数组数据以及处理 1.示例 比如输入:4 (表示输入的数组大小) 3 5 6 1 (具体输入的元素) 2.代码 (1).利用while循环输入 //利用while循环进行 public class Test { public static void main(Strin
2017-08-06 14:26:31
562
原创 Plus One【加一】【容易】
一、题目 英文:Plus One 中文:加一 二、内容要求 英文:Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not contain any leading zero, ex
2017-08-06 12:58:42
695
原创 Guess Number Higher or Lower II
一、题目 英文:Guess Number Higher or Lower II 中文:猜数字大小 二、内容要求 英文:We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every ti
2017-07-28 21:12:58
278
原创 Coin Change【硬币找零】
一、题目 英文:Coin Change 中文:硬币找零 二、内容要求 英文:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need
2017-07-28 20:54:19
699
原创 Maximum Length of Pair Chain【双链的最大长度】
一、题目 英文:Maximum Length of Pair Chain 中文:双链的最大长度 二、内容要求 英文: You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. Now, we define a pa
2017-07-28 15:41:36
625
原创 Climbing Stairs【爬梯子问题】【容易】
一、题目 英文:Climbing Stairs 中文:爬梯子 二、内容要求 英文: 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 yo
2017-07-28 15:03:09
490
原创 Best Time to Buy and Sell Stock 【最佳买卖股票的时间】【容易】
一、题目 英文:Best Time to Buy and Sell Stock 中文:最佳买卖股票的时间 二、内容要求 英文: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to comple
2017-07-28 14:03:22
471
原创 House Robber【打家劫舍】【容易】
一、题目 英文:House Robber 中文:打家劫舍 二、内容要求 英文:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you f
2017-07-28 11:58:36
463
原创 Maximum Subarray【最大子串和问题】【容易】
一、题目 英文:Maximum Subarray 中文:最大子串和 二、内容要求 英文:Find the contiguous subarray within an array (containing at least one number) which has the largest sum. 中文:在数组中找到子串(至少包含一个数字),使得和是最大的。 三、示例 例如
2017-07-28 09:50:14
389
原创 Range Sum Query - Immutable【数组指定区间内的元素和】
一、题目 英文:Range Sum Query - Immutable 中文:数组指定区间内的元素和 二、内容要求 英文:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. 中文:给定一个数组nums,求出索引i和j之间元素的
2017-07-27 23:30:19
411
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅