慕课网学习笔记
JRUBYcsdn
这个作者很懒,什么都没留下…
展开
-
LeetCode 75. Sort Colors
Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the inte...原创 2018-05-01 10:09:55 · 115 阅读 · 0 评论 -
LeetCode 198. House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house...原创 2018-05-20 16:13:56 · 124 阅读 · 0 评论 -
LeetCode 279. Perfect Squares
Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.For example, given n = 12, return 3 because 12 = 4 + 4 + 4; given n = 13, ret...原创 2018-05-10 19:46:43 · 122 阅读 · 0 评论 -
LeetCode 438. Find All Anagrams in a String
Given a string s and a non-empty string p, find all the start indices of p's anagrams in s.Strings consists of lowercase English letters only and the length of both strings s and p will not be larger ...原创 2018-05-02 16:38:30 · 162 阅读 · 0 评论 -
LeetCode 3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", with the l...原创 2018-05-02 15:12:31 · 112 阅读 · 0 评论 -
LeetCode 209. Minimum Size Subarray Sum
Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn't one, return 0 instead.Example: Input: [2,3,1,2,4,3...原创 2018-05-02 14:55:05 · 129 阅读 · 0 评论 -
LeetCode 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 of line i is at (i, ai) and (i, 0). Find two ...原创 2018-05-01 22:53:19 · 117 阅读 · 0 评论 -
LeetCode 125. Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.Note: For the purpose of this problem, we define empty string as valid palindrome.Example 1...原创 2018-05-01 21:20:11 · 141 阅读 · 0 评论 -
LeetCode 167. Two Sum II - Input array is sorted
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers su...原创 2018-05-01 20:37:54 · 100 阅读 · 0 评论 -
LeetCode 215. Kth Largest Element in an Array
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,Given [3,2,1,5,6,4] and k = 2, return 5.Note: Y...原创 2018-05-01 17:21:26 · 127 阅读 · 0 评论 -
LeetCode 88. Merge Sorted Array
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:The number of elements initialized in nums1 and nums2 are m and n respectively.You may assume that nums...原创 2018-05-01 11:28:48 · 119 阅读 · 0 评论 -
LeetCode 416. 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 of the array element w...原创 2018-05-20 22:38:08 · 122 阅读 · 0 评论