ARTS #44 Algorithm 本周选择的算法题是:Regular Expression Matching 规则如下: Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. '.' Matches any single cha...
ARTS #43 Algorithm 本周选择的算法题是:Network Delay Time 规则如下: There are N network nodes, labelled 1 to N. Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node, ...
ARTS #42 Algorithm 本周选择的算法题是:Unique Paths II 规则如下: A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either down or right at any po...
ARTS #41 Algorithm 本周选择的算法题是:Unique Paths 规则如下: A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either down or right at any point...
ARTS #40 Algorithm 本周选择的算法题是:Subsets II 规则如下: Given a collection of integers that might contain duplicates, *nums*, return all possible subsets (the power set). Note: The solution set must not contain d...
ARTS #39 Algorithm 本周选择的算法题是:Rotate Image 规则如下: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Note: You have to rotate the image in-place, which m...
ARTS #38 Algorithm 本周选择的算法题是:Integer to Roman 规则如下: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10...
ARTS #37 Algorithm 本周选择的算法题是:Pascal’s Triangle II 规则如下: Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal’s triangle. Note that the row index starts from 0. In Pascal’s...
ARTS #36 Algorithm 本周选择的算法题是:Trapping Rain Water 规则如下: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after rainin...
ARTS #35 Algorithm 本周选择的算法题是:First Missing Positive 规则如下: Given an unsorted integer array, find the smallest missing positive integer. Example 1: Input: [1,2,0] Output: 3 Example 2: Input: [3,4,-1,1...