10 Duke700

尚未进行身份认证

我要认证

暂无相关简介

等级
TA的排名 7w+

LeetCode之81. Search in Rotated Sorted Array II.cpp

题目原文:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,0,1,2,2,5,6] might become [2,5,6,0,0,1,2]).You are given a target value to search. If found...

2018-05-17 23:45:18

LeetCode之33. Search in Rotated Sorted Array

题目原文:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).You are given a target value to search. If found...

2018-05-17 23:41:24

LeetCode之80. Remove Duplicates from Sorted Array II

题目原文:Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length.Do not allocate extra space for another array, you must do this by ...

2018-05-16 23:42:24

LeetCode之26. Remove Duplicates from Sorted Array

题目原文:Given a sorted array nums, 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 modi...

2018-05-16 23:35:23

常量指针与指针常量之区别

在说常量指针与指针常量之前,先来看一看一个普通指针的使用int *pa 大家知道pa代表一个指向int类型值的指针.用另一种方式解读为:取pa所指向的地址内的值后,其值类型为int应该说,编译器只认识的是int型,int*型是不存在的int *pa 应该看作  int (*pa)                   而非 (int*) pa               

2016-07-01 18:10:31

LeetCode之18_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: T

2016-06-26 14:15:26

LeetCode之17_Letter Combinations of a Phone Number

题目原文:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.

2016-06-26 14:08:04

LeetCode之16_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 h

2016-06-26 13:59:35

LeetCode之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 must

2016-06-26 13:53:47

LeetCode之14_Longest Common Prefix

题目原文:Write a function to find the longest common prefix string amongst an array of strings.题意分析:传入多个存储在vector容器中的字符串,计算其公共最长前缀,公共最长前缀要求是连续的,与动态规划的最长公共子序列不同为减少比较次数,可以逐个寻找两个字符串之间

2016-06-26 13:40:35

LeetCode之13_Integer to Roman

题目原文:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.题意分析:把一个给出的罗马数字转换成为阿拉伯数字表示的整数解题时将罗马数字对应的阿拉伯数字依次转换出来即可,需要注意,如果存在左边的罗

2016-06-26 13:16:14

LeetCode之12_Integer to Roman

题目原文:Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.Subscribe to see which companies asked this question题目分析:将数字转换为

2016-06-16 23:08:44

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 (

2016-06-16 22:18:44

LeetCode之10_Regular Expression Matching

题目原文:Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the enti

2016-06-16 22:03:25

LeetCode之9_Palindrome Number

题目原文:Determine whether an integer is a palindrome. Do this without extra space.题意分析:不使用额外空间,判断给定的一个整数是否为回文整数。如果只是求回文数字很简单,题目的难度在于不使用额外的空间(此处认为除了传入参数,临时变量的使用为额外空间,运行过程中产生的栈对象不考虑)此处判断首尾是

2016-05-15 01:29:52

LeetCode之8_String to Integer (atoi)

题目原文:Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the po

2016-04-04 23:50:12

LeetCode之7_Reverse Integer

题目原文: Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Subscribe to see which companies asked this question 分析:将整数倒

2016-04-04 19:02:32

LeetCode之6_ZigZag Conversion

题目原文: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H N

2016-04-04 18:58:57

LeetCode之5_Longest Palindromic Substring

题目原文: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.Subscrib

2016-04-04 18:29:40

LeetCode之4_Median of Two Sorted Arrays

题目原文: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Subscribe t

2016-04-04 18:23:00

查看更多

勋章 我的勋章
  • 专栏达人
    专栏达人
    授予成功创建个人博客专栏的用户。专栏中添加五篇以上博文即可点亮!撰写博客专栏浓缩技术精华,专栏达人就是你!