随笔分类 - RP
摘要:Find Minimum in Rotated Sorted Array I 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 
        阅读全文
                
摘要:Given an absolute path for a file (Unix-style), simplify it. Have you met this question in a real interview? Yes Example "/home/", => "/home" "/a/./b/
        阅读全文
                
摘要:Integer to Roman Given an integer, convert it to a roman numeral. The number is guaranteed to be within the range from 1 to 3999. Integer to Roman Giv
        阅读全文
                
摘要:Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is formed from t
        阅读全文
                
摘要:Given a string source and a string target, find the minimum window in source which will contain all the characters in target. Notice If there is no su
        阅读全文
                
摘要:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Have you met this question in a real interview? Yes Exam
        阅读全文
                
摘要:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the
        阅读全文
                
摘要:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, 
        阅读全文
                
摘要:Next Permutation Given a list of integers, which denote a permutation. Find the next permutation in ascending order. Notice The list may contains dupl
        阅读全文
                
摘要:Determine the number of bits required to flip if you want to convert integer n to integer m. Notice Both n and m are 32-bit integers. Determine the nu
        阅读全文
                
摘要:Given n pieces of wood with length L[i] (integer array). Cut them into small pieces to guarantee you could have equal or more than k pieces with the s
        阅读全文
                
摘要:There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it cost
        阅读全文
                
摘要:Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endp
        阅读全文
                
摘要:Insert Intervals Given a non-overlapping interval list which is sorted by start point. Insert a new interval into it, make sure the list is still in o
        阅读全文
                
摘要:Find the kth smallest number in at row and column sorted matrix. Example Given k = 4 and a matrix: [ [1 ,5 ,7], [3 ,7 ,8], [4 ,8 ,9], ] return 5. 分析: 
        阅读全文
                
摘要:Divide two integers without using multiplication, division and mod operator. If it is overflow, return 2147483647 Example Given dividend = 100 and div
        阅读全文
                
摘要:Determine whether a Sudoku is valid. The Sudoku board could be partially filled, where empty cells are filled with the character .. Notice A valid Sud
        阅读全文
                
摘要:Valid Parentheses Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. Example The b
        阅读全文
                
摘要:Given a boolean 2D matrix, find the number of islands. Notice 0 is represented as the sea, 1 is represented as the island. If two 1 is adjacent, we co
        阅读全文
                
摘要:Given a string containing only digits, restore it by returning all possible valid IP address combinations. Given a string containing only digits, rest
        阅读全文
                
                    
                
浙公网安备 33010602011771号