LeetCode_Excel Sheet Column Title
Excel Sheet Column Title
Given a positive integer, return its corresponding column title as appear in an Excel sheet.
(将数值转换成EXCEL表格中的列名称)
LeetCode_Two Sum II
Two Sum II
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 such that they add up to the target, where index1 must be less than index2.
(一个升序数组中某两个元素的和为给定值)
LeetCode_Fraction to Recurring Decimal
Fraction to Recurring Decimal
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating, enclose the repeating part in parentheses.
(分数->小数)
LeetCode_Compare Version Numbers
Compare Version Numbers
Compare two version numbers version1 and version2. If version1 > version2
return 1; if version1 < version2
return -1; otherwise return 0. You may assume that the version strings are non-empty and contain only digits and the . character. The . character does not represent a decimal point and is used to separate number sequences.
For instance, 2.5 is not “two and a half” or “half way to version three”, it is the fifth second-level revision of the second first-level revision. You may assume the default revision number for each level of a version number to be 0. For example, version number 3.4 has a revision number of 3 and 4 for its first and second level revision number. Its third and fourth level revision number are both 0.
(比较’.’分开的数值大小)
LeetCode_Maximum Gap
Maximum Gap
Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Return 0 if the array contains less than 2 elements.
(乱序数组的排序后相邻元素差最大值)
LeetCode_Find Peak Element
Find Peak Element
A peak element is an element that is greater than its neighbors. sGiven an input array nums, where nums[i] ≠ nums[i+1], find a peak element and return its index. The array may contain multiple peaks, in that case return the index to any one of the peaks is fine. You may imagine that nums[-1] = nums[n] = -∞.
(找到数组中的“波峰”值的index,一个即可。要求时间复杂度为O(logn))
LeetCode_Intersection of Two Linked Lists
Intersection of Two Linked Lists
Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists:
(两个链表相交的结点)
LeetCode_Min Stack
Min Stack
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
- push(x) – Push element x onto stack.
- pop() – Removes the element on top of the stack.
- top() – Get the top element.
- getMin() – Retrieve the minimum element in the stack.
(设计一个堆栈类,并可以O(1)定位到最小值)
LeetCode_Find Minimum in Rotated Sorted Array II
Find Minimum in Rotated Sorted Array II
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]). Find the minimum element. The array may contain duplicates.
(确定一个升序序列经过某个位置翻转后的数组的最小值(有重复元素))