摘要:
Give an integer array,find the longest increasing continuous subsequence in this array. An increasing continuous subsequence: Can be from right to lef 阅读全文
摘要:
Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than 阅读全文
摘要:
Given an encoded string, return its decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is be 阅读全文
摘要:
A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules: This is how the UTF-8 encoding would work: Given an array of inte 阅读全文
摘要:
Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both s and t. t is po 阅读全文
摘要:
Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Return 0 if the array contains less than 2 el 阅读全文
摘要:
Given a set of n nuts of different sizes and n bolts of different sizes. There is a one-one mapping between nuts and bolts. Comparison of a nut to ano 阅读全文
摘要:
Find the kth smallest number in at row and column sorted matrix. Have you met this question in a real interview? Yes Find the kth smallest number in a 阅读全文
摘要:
Given N axis-aligned rectangles where N > 0, determine if they all together form an exact cover of a rectangular region. Each rectangle is represented 阅读全文
摘要:
Given an integer array, find a continuous subarray where the sum of numbers is the biggest. Your code should return the index of the first number and 阅读全文
摘要:
Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at 阅读全文
摘要:
Given an integer matrix, find a submatrix where the sum of numbers is zero. Your code should return the coordinate of the left-up and right-down numbe 阅读全文
摘要:
Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 阅读全文
摘要:
Suppose we abstract our file system by a string in the following manner: The string "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext" represents: The director 阅读全文
摘要:
Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: Note: You may assume the 阅读全文
摘要:
Given an integer n, return 1 - n in lexicographical order. For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9]. Please optimize your algori 阅读全文
摘要:
Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is a 阅读全文
摘要:
Given two binary strings, return their sum (also a binary string). Have you met this question in a real interview? Yes Given two binary strings, retur 阅读全文
摘要:
The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total num 阅读全文
摘要:
Shuffle a set of numbers without duplicates. Example: 这道题让我们给数组洗牌,也就是随机打乱顺序,那么由于之前那道题Linked List Random Node我们接触到了水塘抽样Reservoir Sampling的思想,这道题实际上这道题也 阅读全文
摘要:
There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following re 阅读全文
摘要:
Reverse digits of an integer. Returns 0 when the reversed integer overflows (signed 32-bit integer). Reverse digits of an integer. Returns 0 when the 阅读全文
摘要:
Given a nested list of integers represented as a string, implement a parser to deserialize it. Each element is either an integer, or a list -- whose e 阅读全文
摘要:
Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the rans 阅读全文
摘要:
Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen. Implement the 阅读全文
摘要:
Design a data structure that supports all following operations in average O(1) time. Note: Duplicate elements are allowed. insert(val): Inserts an ite 阅读全文
摘要:
Divide two integers without using multiplication, division and mod operator. If it is overflow, return 2147483647 Divide two integers without using mu 阅读全文