
算法
文章平均质量分 76
小侨流水
努力学习中
展开
-
Algorithm-week2
Week2Program--MediumGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys原创 2017-09-13 12:14:32 · 171 阅读 · 0 评论 -
Algorithm-week16
Week16Problem--Medium--392. Is SubsequenceGiven a string s and a string t, check if s is subsequence of t.You may assume that there is only lower case English letters in both s and t. t is原创 2017-12-07 21:18:32 · 153 阅读 · 0 评论 -
Algorithm-week14
Week14Problem--Medium--647. Palindromic SubstringsGiven a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end in原创 2017-12-06 20:54:39 · 207 阅读 · 0 评论 -
Algorithm-week12
Week12Problem--Medium--714. Best Time To Buy and Sell Stock with Transaction FeeYour are given an array of integers prices, for which the i-th element is the price of a given stock on day i;原创 2017-11-26 21:43:27 · 170 阅读 · 0 评论 -
Algorithm-week15
Week14Problem--Medium--646. Maximum Length of Pair ChainYou are given n pairs of numbers. In every pair, the first number is always smaller than the second number.Now, we define a pair (c,原创 2017-12-07 20:37:50 · 184 阅读 · 0 评论 -
Algorithm-week11
Week11Problem--Medium--718. Maximum Length of Repeated SubarrayGiven two integer arrays A and B, return the maximum length of an subarray that appears in both arrays.Example 1:Input:A原创 2017-11-25 11:27:22 · 181 阅读 · 0 评论 -
Algorithm-week13
Week13Problem--Medium--673. Number of Longest Increasing SubsequenceGiven an unsorted array of integers, find the number of longest increasing subsequence.Example 1:Input: [1,3,5,4,7]Ou原创 2017-11-30 00:12:08 · 133 阅读 · 0 评论 -
Algorithm-week9
Week9Problem--Medium--338. Counting BitsGiven a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r原创 2017-10-28 11:48:23 · 165 阅读 · 0 评论 -
Algorithm-week10
Week10Problem--Medium--413. Arithmetic SlicesA sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is t原创 2017-10-28 21:36:08 · 138 阅读 · 0 评论 -
Algorithm-week7
Week7Program--Medium--537.Complex Number MultiplicationGiven two strings representing two complex number.You need to return a string representing their multiplication. Note i2 = -1 according原创 2017-10-22 21:17:28 · 227 阅读 · 0 评论 -
Algorithm-week6
Week6Program--Medium--419. Battleships in a BoardGiven an 2D board, count how many battleships are in it. The battleships are represented with 'X's, empty slots are represented with '.'s. Yo原创 2017-10-09 13:09:56 · 220 阅读 · 0 评论 -
Algorithm-week8
Week8Program--Medium--712.Minimum ASCII Delete Sum for Two StringsGiven two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equal.Example 1:Input:原创 2017-10-27 15:10:20 · 177 阅读 · 0 评论 -
Algorithm-week4
Week3Program--Medium--399. Evaluate DivisionEquations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). G原创 2017-09-29 20:52:04 · 228 阅读 · 0 评论 -
Algorithm-week5
Week5Program--Medium--611. Valid Triangle NumberGiven an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if原创 2017-10-08 22:51:21 · 213 阅读 · 0 评论 -
Algorithm-week3
Week3Program--MediumDesign a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal word or a regular expression原创 2017-09-20 14:10:07 · 278 阅读 · 0 评论 -
Algorithm-week1
Week1原创 2017-09-06 23:14:48 · 190 阅读 · 0 评论 -
Algorithm-week17
Week17Problem--8.19A kite is a graph on an even number of vertices, say 2n, in which n of the vertices form a clique and the remaining n vertices are connected in a "tail" that consists of a path原创 2018-01-03 10:50:12 · 175 阅读 · 0 评论