Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete at most two transactions. ...You ma
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete at most two transactions. ...You ma
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representation of s1 = "great": great ...
Edit Distance of the Two WordsGiven two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3...
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n = 3, your program should return all 5 unique BST's shown below. ...
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example, Given: s1 = "aabcc", s2 = "dbbca", When s3 = "aadbbcbcac...When s3 = "aadbbbaccc",
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Above is a histogram where width of each ...
Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 1
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Follow up: ...Did you use extra space?...A straight forward solution using O(mn) space is probably a ...
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example, S = "ADOBECODEBANC" T = "ABC" ...Minimum window is ...
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from C ...
This is an efficient and fast solver for Sudoku problem. I passed the large test within 24ms. The problem is below: ...Write a program to solve a Sudoku puzzle by filling the empty cells.
Again, similar as the previous one, this combination sum could also be solved by DFS http://blog.csdn.net/u010204902/article/details/8803342 How to make sure that the result is unique? We nee
Anagrams Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lower-case. The basic idea is easy. From the definition of anagrams, we just n
The time complexity of Merge Sort is nlogn. How about the external merge sort? 1. One pass external merge sort step 1. break N data to k groups, each group has N/k data, complexity is N/klog(N/
Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. ...Your algorithm should run in O(n) ...
初识AR2220信息中心...为了更好地监控网络运行状况,现为AR2220路由器搭建一台日志服务器,作为以后系统故障查找、排除的参考。 准备工作:HuaweiAR2220(V200R001C01) Dell PE4600 Redhat Enterprise Linu...
以下是本人学习linux基础时的笔记,有不正确的地方欢迎大家批评指正! cd(Change Directory) 语法:cd [-L|-P] [dir] ...功能:cd(Change Directory),改变当前工作目录。...切换至用户主目录,环境变量$HOME保存着...
在BIRT中使用动态图片 BIRT中插入图片的方式有4种:使用图片的URI,使用BIRT shared resources 下面的图片,直接把图片文件嵌入BIRT Template中,还要就是从数据集里面获得图片数据。前面三种方式比较容易使用,但...
我用的邮箱类型是:microsoft exchange server不是(pop3,imap... 无法访问用文件夹,及邮箱-henryzhang,还提示”你没有权限访问...文件夹“, 为什么有的帐户就可以收发,有的帐户就不能收发,而且提示上面的错误呢?