leetcode
chenchun199627
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Sort List
题意:对链表进行排序 思路:将链表用一个ArrayList保存,再sort()排序,构造一个新链表 public ListNode sortList(ListNode head) { if(head==null)return head; ArrayListtemp=new ArrayList while(head!=null){ temp.add(head.val); head=h原创 2016-11-21 22:39:00 · 251 阅读 · 0 评论 -
Multiply Strings
大整数乘法 思路:讲各位相乘的数保存在数组里,再将各个余数用一个StringBulider的insert方法逐个插入(insert方法将指定数符插入指定位置) public class MultiplyStrings { public String multiply(String num1, String num2) { num1=new StringBuffer(num1).re转载 2016-11-20 22:40:37 · 250 阅读 · 0 评论 -
Maximum Subarray
题目: Maximum Subarray 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,4,-1,2,1,-5,4], the contiguou原创 2016-11-23 16:26:43 · 223 阅读 · 0 评论 -
Guess Number Higher or Lower
题目: 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 time you guess wrong, I'll tell you whether the number i原创 2016-11-24 18:44:53 · 259 阅读 · 0 评论 -
Move Zeroes
题目: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, given nums = [0, 1, 0, 3, 12], after call原创 2016-11-24 18:31:55 · 229 阅读 · 0 评论
分享