上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 28 下一页
摘要: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.解题思路一:使用一个nums1Copy把nums1的前m个元素拷贝出来,然后把nums1Copy和nums2放进nu... 阅读全文
posted @ 2015-05-20 00:20 TonyLuis 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representatio... 阅读全文
posted @ 2015-05-19 23:57 TonyLuis 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the o... 阅读全文
posted @ 2015-05-19 21:47 TonyLuis 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.解题思路:求01矩阵中,全是1的子矩阵的最大面积。把矩阵按照每一行... 阅读全文
posted @ 2015-05-19 19:44 TonyLuis 阅读(148) 评论(0) 推荐(0) 编辑
摘要: For example,Given height = [2,1,5,6,2,3],return 10.解题思路:参考Problem H: Largest Rectangle in a Histogram 第四种思路,或者翻译版Largest Rectangle in Histogram@LeetCo... 阅读全文
posted @ 2015-05-19 18:10 TonyLuis 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3,... 阅读全文
posted @ 2015-05-19 12:44 TonyLuis 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example,Given 1->2... 阅读全文
posted @ 2015-05-19 12:29 TonyLuis 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a function ... 阅读全文
posted @ 2015-05-19 10:47 TonyLuis 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array nums = [1,1,1,2,2,3],Your function shou... 阅读全文
posted @ 2015-05-18 23:31 TonyLuis 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjace... 阅读全文
posted @ 2015-05-18 23:13 TonyLuis 阅读(183) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 28 下一页