- 博客(10)
- 问答 (1)
- 收藏
- 关注
原创 227. Basic Calculator II
Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division should
2017-07-12 23:03:18 100
原创 209. Minimum Size Subarray Sum
Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ? s. If there isn't one, return 0 instead. For example, given the
2017-07-07 21:13:23 138
原创 201. Bitwise AND of Numbers Range
Given a range [m, n] where 0 For example, given the range [5, 7], you should return 4. int rangeBitwiseAnd(int m, int n) { int result[32] = {0}; int temp; //哎, 为了解决m + (j << 1) - (m & ans)可能出现的溢
2017-07-06 21:33:25 120
原创 204. Count Primes
int countPrimes(int n) { int i, j, count; int* array = calloc(n, sizeof(int));//0 means primary for(i=2; i * i <= n; i++) { if(array[i] == 1) continue; for(j = 2; j * j <=
2017-07-06 00:15:31 86
原创 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. Example: Input: "babad" Output: "bab" Note: "aba" is also a valid answer.
2017-02-27 21:21:16 103
原创 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)).Example 1:nums1 = [1, 3] nums2
2017-02-25 09:23:15 251
原创 34. Search for a Range
Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the order of O(log n). If the
2017-02-23 18:49:59 168
原创 31、Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible
2017-02-23 13:59:43 122
原创 2. Add Two Numbers
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i
2017-02-15 19:33:23 133
原创 3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the length is 3. Given "bbbbb", the answer is "
2017-02-14 11:58:16 124
空空如也
关于C++ share_ptr构造函数的问题
2017-09-21
TA创建的收藏夹 TA关注的收藏夹
TA关注的人