摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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] + 阅读全文
摘要:
Implement a trie with insert, search, and startsWith methods. Note: You may assume that all inputs are consist of lowercase letters a-z. Solution: 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
296. Best Meeting Point Total Accepted: 6496 Total Submissions: 13313 Difficulty: Hard Total Accepted: 6496 Total Submissions: 13313 Difficulty: Hard 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文