原创 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 t

原创 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

原创 LeetCode之6_ZigZag Conversion

題目原文:   The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want

原创 LeetCode之8_String to Integer (atoi)

題目原文: Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you w

原创 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

原创 常量指針與指針常量之區別

在說常量指針與指針常量之前,先來看一看一個普通指針的使用 int *pa 大家知道pa代表一個指向int類型值的指針.用另一種方式解讀爲:取pa所指向的地址內的值後,其值類型爲int 應該說,編譯器只認識的是int型,int*型是不存在

原创 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 arr

原创 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

原创 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,

原创 LeetCode之9_Palindrome Number

題目原文: Determine whether an integer is a palindrome. Do this without extra space. 題意分析: 不使用額外空間,判斷給定的一個整數是否爲迴文整數。 如果只是求

原创 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. 題