发布时间:2015-05-29 14:23:16
//Given a sorted array of integers, 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 target is not found in the array, return [-1, -1].////For example,//Given [5, 7, 7, 8, 8, 10] and target value.........【阅读全文】
发布时间:2015-05-25 18:55:28
//Suppose a sorted array 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).////You are given a target value to search. If found in the array return its index, otherwise return -1.////You may assume no duplicate exists in the array.public .........【阅读全文】
发布时间:2015-05-02 10:53:04
//Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.////For "(()", the longest valid parentheses substring is "()", which has length = 2.////Another example is ")()())", where the longest valid parentheses substrin.........【阅读全文】
发布时间:2015-04-16 15:56:43
//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 order (ie, sorted in ascending order).////The replacement must be in-place, do not allocate e.........【阅读全文】
发布时间:2015-04-16 11:15:58
//You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without any intervening characters.import java.util.ArrayList;import java.util.HashMap;import java.util.L.........【阅读全文】