摘要:
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".For C programmers: Try to solv... 阅读全文
摘要:
Description:Count the number of prime numbers less than a non-negative number,n.思路:这题第一种思路是写一个is_prime函数,来对每一个数验证一次是否是prime。这个方法在这个题里表现不快,但也是一个学习is_pr... 阅读全文
摘要:
Given an arraynumsand a target valuek, find the maximum length of a subarray that sums tok. If there isn't one, return 0 instead.Example 1:Givennums=[... 阅读全文
摘要:
Given a collection of integers that might contain duplicates,nums, return all possible subsets.Note:Elements in a subset must be in non-descending ord... 阅读全文
摘要:
Given a string arraywords, find the maximum value oflength(word[i]) * length(word[j])where the two words do not share common letters. You may assume t... 阅读全文
摘要:
Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your... 阅读全文
摘要:
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文
摘要:
There are two sorted arraysnums1andnums2of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should... 阅读全文
摘要:
This article was found from Geeksforgeeks.org.Click here to see the original article.Given an integer array of n integers, find sum of bit differences... 阅读全文
摘要:
Find all possible combinations ofknumbers that add up to a numbern, given that only numbers from 1 to 9 can be used and each combination should be a u... 阅读全文