上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 36 下一页
摘要: Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. For example, Assume that words 阅读全文
posted @ 2016-08-23 12:50 LiBlog 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from Wikipedia: In a complete binary tree every level, e 阅读全文
posted @ 2016-08-22 12:40 LiBlog 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Given a list of unique words. Find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + 阅读全文
posted @ 2016-08-22 10:25 LiBlog 阅读(570) 评论(0) 推荐(0) 编辑
摘要: Implement a trie with insert, search, and startsWith methods. Note: You may assume that all inputs are consist of lowercase letters a-z. Solution: 阅读全文
posted @ 2016-08-22 08:49 LiBlog 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes 阅读全文
posted @ 2016-08-21 15:17 LiBlog 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the length of the longest consecutive sequence path. The path refers to any sequence of nodes from some starting node to any 阅读全文
posted @ 2016-08-21 14:51 LiBlog 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. Except for the f 阅读全文
posted @ 2016-08-21 13:44 LiBlog 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 296. Best Meeting Point Total Accepted: 6496 Total Submissions: 13313 Difficulty: Hard Total Accepted: 6496 Total Submissions: 13313 Difficulty: Hard 阅读全文
posted @ 2016-08-21 11:46 LiBlog 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Given a nested list of integers represented as a string, implement a parser to deserialize it. Each element is either an integer, or a list -- whose e 阅读全文
posted @ 2016-08-19 15:15 LiBlog 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2 阅读全文
posted @ 2016-08-19 13:59 LiBlog 阅读(127) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 36 下一页