
LeetCode
qq_38040674
这个作者很懒,什么都没留下…
展开
-
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.Examp...原创 2018-07-08 13:30:55 · 216 阅读 · 0 评论 -
LeetCode 344. Reverse String
题目描述 Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".代码实现class Solution {public: string reverseString(string s) { r...原创 2018-07-08 13:41:18 · 171 阅读 · 0 评论 -
LeetCode 345. Reverse Vowels of a String
题目描述Write a function that takes a string as input and reverse only the vowels of a string.Example 1:Given s = "hello", return "holle".Example 2:Given s = "leetcode", return "leotcede".Note:The vowels ...原创 2018-07-08 14:44:49 · 223 阅读 · 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: s = 7, n...原创 2018-07-08 19:20:54 · 242 阅读 · 0 评论 -
LeetCode 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, 3, 12], after calling your...原创 2018-07-06 15:46:41 · 110 阅读 · 0 评论 -
LeetCode 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 by modifying the input array in-p...原创 2018-07-06 18:27:56 · 119 阅读 · 0 评论 -
LeetCode 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 for another array, you must do this by modifying...原创 2018-07-06 19:08:03 · 162 阅读 · 0 评论 -
LeetCode 80. Remove Duplicates from Sorted Array II
问题描述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 should return length = 5, with the first five e...原创 2018-07-06 19:29:00 · 151 阅读 · 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 ...原创 2018-07-06 20:08:10 · 167 阅读 · 0 评论