- 博客(3)
- 收藏
- 关注
原创 leetcode003-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.
2017-09-24 16:29:13 252
原创 leetcode002-数值处理Reverse Integer,Pow(x,n), atoi, Divide Two Integers
反转正数和求指数幂的算法都挺简单的,写这两道题是为了记录一些在进行数值处理时要注意的边界条件和细节。Reverse IntegerReverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321基本思路:通过取模运算每次得到数字最右边的一位a,
2017-09-17 19:41:05 372
原创 leetcode001-2Sum,3Sum
2SumGiven an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution.Example:Gi
2017-09-10 23:47:01 227
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人