摘要:
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example,Given [100, 4, 200, 1, 3, 2],The longes... 阅读全文
摘要:
Given two words (beginWord and endWord), and a dictionary, find the length of shortest transformation sequence from beginWord to endWord, such that:On... 阅读全文
摘要:
Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that: Only one letter can be c... 阅读全文
摘要:
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan... 阅读全文
摘要:
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree. For example:Given the below binary tree, 1 ... 阅读全文
摘要:
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 complet... 阅读全文
摘要:
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 complet... 阅读全文
摘要:
Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction ... 阅读全文
摘要:
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the fo... 阅读全文
摘要:
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1].解题思路:注意,本题的k相当于上题的k+1,其他照搬即可,JAVA实现如下: pub... 阅读全文