摘要:
Given a string s and a string t, check if s is subsequence of t. Given a string s and a string t, check if s is subsequence of t. You may assume that 阅读全文
摘要:
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ? k ? BST's 阅读全文
摘要:
Recently I transit to use scala to program. scala is a functional and objected oriented language, but it has seamless java Interoperability (they both 阅读全文
摘要:
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted i 阅读全文
摘要:
Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm? Solution: # this is could also be 阅读全文
摘要:
Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. According 阅读全文
摘要:
Given an unsorted array of integers, find the length of longest increasing subsequence. For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest inc 阅读全文
摘要:
Given a set of intervals, for each of the interval i, check if there exists an interval j whose start point is bigger than or equal to the end point o 阅读全文
摘要:
Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses. Now, you are given p 阅读全文