摘要:
二分法相关 153. Find Minimum in Rotated Sorted Array Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might 阅读全文
摘要:
字典树(Trie树相关) 208. Implement Trie (Prefix Tree) Implement a trie with insert, search, and startsWith methods. (Medium) Note:You may assume that all inp 阅读全文
摘要:
数学题 172. Factorial Trailing Zeroes Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time c 阅读全文
摘要:
位运算相关 三道题 231. Power of Two 位运算相关 三道题 231. Power of Two Given an integer, write a function to determine if it is a power of two. (Easy) 分析: 数字相关题有的可以考 阅读全文
摘要:
Implement the following operations of a stack using queues. (Easy) push(x) -- Push element x onto stack. pop() -- Removes the element on top of the st 阅读全文
摘要:
Evaluate the value of an arithmetic expression in Reverse Polish Notation. (Medium) Valid operators are +, -, *, /. Each operand may be an integer or 阅读全文
摘要:
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. (Easy) For example,"A man, a plan, a can 阅读全文
摘要:
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. (Hard) For example,Given [100, 4, 200, 1, 3, 2],The 阅读全文
摘要:
Given a binary tree, find the maximum path sum. (Hard) For this problem, a path is defined as any sequence of nodes from some starting node to any nod 阅读全文
摘要:
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文