- 博客(8)
- 收藏
- 关注
原创 315.leetcode Count of Smaller Numbers After Self(hard)[利用二分查找 空间换取时间的思想]
You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smaller elements to the right of nums[i]. Example
2016-10-08 21:08:56 368
原创 396.leetcode Rotate Function(easy)[找规律]
Given an array of integers A and let n to be its length. Assume Bk to be an array obtained by rotating the array A k positions clock-wise, we define a "rotation function" F on A as follow:
2016-10-08 19:46:41 230
原创 334.leetcode Increasing Triplet Subsequence(medium)[巧妙的方法减少时间与空间复杂度]
Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return true if there exists i, j, k such that arr[i] ar
2016-10-07 21:47:16 250
原创 397.leetcode Integer Replacement(easy)[数字处理 溢出]
Given a positive integer n and you can do operations as follow: If n is even, replace n with n/2.If n is odd, you can replace n with either n + 1 or n - 1. What is the minimum number o
2016-10-07 21:11:45 264
原创 409.leetcode Longest Palindrome(easy)[字符串处理 最长回文]
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This is case sensitive, for example "Aa" is not con
2016-10-07 16:48:57 302
原创 371.leetcode Sum of Two Integers(easy)[异或 与运算处理]
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example: Given a = 1 and b = 2, return 3. 两个数相加但是不能用+、-运算符则考虑从位运算的角度来解决问题,观察二进制加法的特点,如果没有进位的时候结果是
2016-10-07 16:00:05 226
原创 404.leetcode Sum of Left Leaves(easy)[二叉树 递归]
Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 15 respectively. Return 24
2016-10-07 15:34:18 211
原创 389.leetcode Find the Difference(easy)[字符串处理]
Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at a random position. Find the letter that was
2016-10-07 15:21:51 201
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人