- 博客(15)
- 资源 (5)
- 收藏
- 关注
原创 LeetCode OJ 系列之63 Unique Paths II --Python
Problem:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respecti
2015-11-27 12:05:38 435
原创 LeetCode OJ 系列之62 Unique Paths --Python
Problem: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
2015-11-27 12:04:08 348
原创 LeetCode OJ 系列之1 Two Sum --Python
Problem:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to t
2015-11-27 12:02:31 387
原创 LeetCode OJ 系列之122 Best Time to Buy and Sell Stock II --Python
Problem:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you li
2015-11-26 09:21:04 431
原创 LeetCode OJ 系列之121 Best Time to Buy and Sell Stock --Python
Problem: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 complete at most one transaction (ie, buy one and sell one share
2015-11-26 09:10:53 421
原创 LeetCode OJ 系列之169 Majority Element --Python
Problem:Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the maj
2015-11-24 09:06:41 808
原创 LeetCode OJ 系列之287 Find the Duplicate Number --Python
Problem:Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplic
2015-11-23 22:00:40 407
原创 LeetCode OJ 系列之219 Contains Duplicate II --Python
Problem: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 between i and jis a
2015-11-23 14:49:36 411
原创 LeetCode OJ 系列之217 Contains Duplicate --Python
Problem: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 it should return false if ever
2015-11-23 14:30:14 704
原创 LeetCode OJ 系列之78 Subsets --Python
Problem:Given a set of distinct integers, nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subset
2015-11-18 22:07:50 1813
原创 LeetCode OJ 系列之26 Remove Duplicates from Sorted Array --Python
Problem: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 for another array, you must do this
2015-11-18 17:02:34 452
原创 LeetCode OJ 系列之27 Remove Element --Python
Problem:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the ne
2015-11-17 13:16:56 584
原创 LeetCode OJ 系列之283 Move Zeroes --Python
Problem: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], aft
2015-11-17 09:00:44 1108
原创 LeetCode OJ 系列之35 Search Insert Position --Python
Problem: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
2015-11-16 22:16:52 429
原创 LeetCode OJ 系列之228 Summary Ranges --Python
Problem:Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].Answer:class Solution(object):
2015-11-16 09:11:30 1023
UNIX环境下C/C++程序的设计(超市帐务管理程序)
2013-05-15
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人