- 博客(27)
- 资源 (2)
- 收藏
- 关注
原创 Subsets II
Given a collection of integers that might contain duplicates, nums, return all possible subsets.Note: The solution set must not contain duplicate subsets.For example,If nums = [1,2,2], a sol
2016-08-24 12:45:24 206
原创 Subsets 子集和
Given a set of distinct integers, nums, return all possible subsets.Note: The solution set must not contain duplicate subsets.For example,If nums = [1,2,3], a solution is:[ [3], [1],
2016-08-24 11:48:46 302
原创 Sort Colors 三色排序
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers
2016-08-23 13:22:32 551
原创 Search a 2D Matrix
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each
2016-08-23 11:09:15 162
原创 Set Matrix Zeroes
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.Follow up:Did you use extra space?A straight forward solution using O(mn) space is probably a bad i
2016-08-23 10:01:09 325
原创 Minimum Path Sum'二维数组最小路径和
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or right at
2016-08-22 19:26:54 1307
原创 Unique Paths和Unique Paths II 路径
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the
2016-08-22 17:03:55 240
原创 Jump Game
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine i
2016-08-21 11:20:07 170
原创 Spiral Matrix 螺旋矩阵
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]
2016-08-20 22:51:35 277
原创 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 contiguous subarray [4,-1,2,1] ha
2016-08-20 21:16:12 169
原创 Combination Sum I,II,III
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited numb
2016-08-20 20:22:33 227
原创 Search Insert Position 插入位置
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.
2016-08-20 09:36:20 337
原创 Search for a Range 区间搜索
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target is not found
2016-08-19 18:07:29 322
原创 Next Permutation下一个全排列序列
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible
2016-08-19 16:38:28 421
原创 4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note: The solution
2016-08-18 19:42:09 217
原创 3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact
2016-08-18 18:28:11 189
原创 3Sum
15. 3Sum Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set
2016-08-18 16:48:07 183
原创 Container With Most Water容器盛水
11. Container With Most Water Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints o
2016-08-18 10:18:43 458
原创 Rotate Array数组旋转
189. Rotate Array 返回将一维数组向右旋转k个位置的结果Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,
2016-08-17 21:37:05 2469
原创 是否包含重复元素2
219. Contains Duplicate II Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j]and the difference b
2016-08-17 20:46:57 198
原创 是否包含重复元素
217. Contains Duplicate Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and
2016-08-17 19:49:38 201
原创 移除0元素
283. 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
2016-08-17 17:09:54 184
原创 合并有序数组
88. Merge Sorted Array Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater o
2016-08-17 10:44:59 201
原创 移除元素
27. Remove Element Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in plac
2016-08-17 09:56:45 751
原创 清除重复元素
26. Remove Duplicates from Sorted Array Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space f
2016-08-17 09:44:57 202
原创 Two Sum and Two Sum II
给定一个整形的数组,找出其中的两个数使其和为某个指定的值,并返回这两个数的下标,假设数组元素的值各不相同。
2016-08-16 23:38:28 252
C3P0-0.9.2.1、commons-dbcp2-2.8.0、commons-pool2-2.9.0、mysql-connector-java-8..zip
2021-05-16
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人