随笔分类 - Algorithm
摘要:Given a list of Connections, which is the Connection class (the city name at both ends of the edge and a cost between them), find some edges, connect 
        阅读全文
                
摘要: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 hist
        阅读全文
                
摘要:Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding elemen
        阅读全文
                
摘要:Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single character. '*' Matches any sequence of characters (including 
        阅读全文
                
摘要:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloon
        阅读全文
                
摘要:Given a sequence of words, and a limit on the number of characters that can be put in one line(line width). Put line breaks in the given sequence such
        阅读全文
                
摘要: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 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area. For example, given the following mat
        阅读全文
                
摘要:Given certain jobs with start and end time and amount you make on finishing the job, find the maximum value you can make by scheduling jobs in non-ove
        阅读全文
                
摘要:Given a string s and a dictionary of words dict, determine if s can be break into a space-separated sequence of one or more dictionary words. Example 
        阅读全文
                
摘要:Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 
        阅读全文
                
摘要:Given an unsorted integer array, find the first missing positive integer. Given an unsorted integer array, find the first missing positive integer. Gi
        阅读全文
                
摘要:Given a sequence of integers, find the longest increasing subsequence (LIS). You code should return the length of the LIS. Clarification What's the de
        阅读全文
                
摘要:Given two rectangles, find if the given two rectangles overlap or not. Notice l1: Top Left coordinate of first rectangle.r1: Bottom Right coordinate o
        阅读全文
                
摘要:There is a stone game.At the beginning of the game the player picks n piles of stones in a line. The goal is to merge the stones in one pile observing
        阅读全文
                
摘要:Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc
        阅读全文
                
摘要:Given a set of words without duplicates, find all word squares you can build from them. A sequence of words forms a valid word square if the kth row a
        阅读全文
                
摘要:Given an integer n, return the number of trailing zeroes in n!. Example 1: Input: 3 Output: 0 Explanation: 3! = 6, no trailing zero. Example 2: Input:
        阅读全文
                
摘要:This blog talks about using dynamic programming to solve the famous 0/1 back pack (knapsack) and its variant problems. BackPack I Given n items with s
        阅读全文
                
摘要:A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given an encoded messag
        阅读全文
                
 
                    
                
 浙公网安备 33010602011771号
浙公网安备 33010602011771号