摘要:
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBECODEBANC"T = "ABC"Minimum window is "BANC".Note:If there is no such window in S that covers all characters in T, return the 阅读全文
摘要:
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or right at any point in time.递归: 1 public static int MinimumPathSum(List<List<int>> grid) 2 { 3 ... 阅读全文
摘要:
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 1 public static ListNode MergeTwoSortedLists(ListNode A, ListNode B) 2 { 3 if (A == null) 4 return B; 5 ... 阅读全文