02 2016 档案
摘要:https://leetcode.com/problems/binary-search-tree-iterator/ Implement an iterator over a binary search tree (BST). Your iterator will be initialized wi
阅读全文
摘要:https://leetcode.com/problems/substring-with-concatenation-of-all-words/ You are given a string, s, and a list of words, words, that are all of the sa
阅读全文
摘要:https://leetcode.com/problems/maximum-product-of-word-lengths/ Given a string array words, find the maximum value of length(word[i]) * length(word[j])
阅读全文
摘要:https://leetcode.com/problems/anagrams/ Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "b
阅读全文
摘要:The trivial way, O(m + n): Merge both arrays and the k-th smallest element could be accessed directly. Merging would require extra space of O(m+n). Th
阅读全文
摘要:public static int[] max_min(int[] a){ //res[0] records the minimum value while res[1] records the maximal one. int res[] = new int[2]; int n = a.lengt
阅读全文
摘要:一道来自jhu algorithm的作业题: Given two sorted arrays A, B, give a linear time algorithm that finds two entries i,j such that|A[i]−B[j]|is minimized. Prove th
阅读全文
摘要:https://leetcode.com/problems/different-ways-to-add-parentheses/ Given a string of numbers and operators, return all possible results from computing a
阅读全文

浙公网安备 33010602011771号