摘要:
题目描述: Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 解题思路: 见代码。 代码如下: 阅读全文
摘要:
题目描述: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n = 3, there are a total of 5 uniqu 阅读全文
摘要:
题目描述: Given an array of integers, every element appears three times except for one. Find that single one. 解题思路: 具体参考Detailed explanation and generaliz 阅读全文
摘要:
题目描述: The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, ea 阅读全文
摘要:
题目描述: Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may 阅读全文
摘要:
题目描述: Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,3,2]. 解题思路: 使用栈。从根节点开 阅读全文