摘要:
如果相邻两个字符在同一个substring里,那么第一个字符在source的index要小于第二个字符。 解法1: 使用dp[i]记录[x,y]. x: shortest way to form target[0:i]; y: current index of target[i-1] in sour 阅读全文
摘要:
Description Find K-th largest element in N arrays. You can swap elements in the array Example Example 1: Input: k=3, [[9,3,2,4,7],[1,2,3,4,8]] Output: 阅读全文
摘要:
Description Given an array of integers, how many three numbers can be found in the array, so that we can build an triangle whose three edges length is 阅读全文
摘要:
Description Given an array of integers, find how many pairs in the array such that their sum is less than or equal to a specific target number. Please 阅读全文
摘要:
又是要对两个字符串一顿操作,返回T or F,典型的dp。 1、建立dp矩阵,确定状态变量:dp[i][j]表示the number of distinct subsequences of s[0:i] which equals t[0:j],就是s[0:i]与t[0:j]带入函数所得值,初值都设为 阅读全文