
c++
sysu_xiamengyou
这个作者很懒,什么都没留下…
展开
-
Remove K Digits
Remove K Digits@(algorithm)[greedy]问题描述: Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. Note:原创 2017-03-23 19:52:29 · 797 阅读 · 0 评论 -
[LeetCode OJ]Partition Equal Subset Sum
【问题描述】Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.Note:Each原创 2017-05-18 22:36:40 · 279 阅读 · 0 评论 -
[LeetCode OJ]Longest Palindromic Subsequence
【问题描述】Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000.Example 1:Input:"bbbab"Output:4One possible lo原创 2017-05-26 23:12:53 · 313 阅读 · 0 评论 -
[LeetCode OJ]Split Array Largest Sum
【问题描述】Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algorithm to minimize the largest sum among原创 2017-05-12 16:52:46 · 370 阅读 · 0 评论 -
[LeetCode OJ]Continuous Subarray Sum
问题描述:Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that sums up to the multiple of k, that is原创 2017-04-23 22:58:05 · 351 阅读 · 0 评论 -
[LeetCode OJ]Triangle
问题描述:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2],原创 2017-05-05 13:51:59 · 444 阅读 · 0 评论 -
[LeetCode OJ]Super Washing Machines
问题描述:You have n super washing machines on a line. Initially, each washing machine has some dresses or is empty.For each move, you could choose any m (1 ≤ m ≤ n) washing machines, and pass on原创 2017-04-15 14:58:22 · 608 阅读 · 0 评论 -
[LeetCode OJ]Target Sum
问题描述:You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol.原创 2017-04-29 20:09:41 · 1063 阅读 · 0 评论 -
Queue Reconstruction by Height
问题描述: Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front o原创 2017-03-26 19:37:20 · 479 阅读 · 0 评论 -
[LeetCode OJ]Maximum Product Subarray
问题描述:Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has t原创 2017-04-09 22:06:14 · 345 阅读 · 0 评论 -
[LeetCode OJ]Swap Nodes in Pairs
【问题描述】Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only const原创 2017-06-04 21:33:11 · 323 阅读 · 0 评论