摘要:
Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: 阅读全文
摘要:
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. 阅读全文
摘要:
ay 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 complete at most two transactions. 阅读全文
摘要:
Say you have an array for which the ith element is the price of a given stock on day i. 阅读全文
摘要:
ay you have an array for which the ith element is the price of a given stock on day i. 阅读全文
摘要:
Given a binary tree, find the maximum path sum. 阅读全文
摘要:
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. 阅读全文
摘要:
Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solution still work? 阅读全文
摘要:
Given an index k, return the kth row of the Pascal's triangle. 阅读全文
摘要:
Given numRows, generate the first numRows of Pascal's triangle. 阅读全文
摘要:
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. 阅读全文
摘要:
Implement an method to compress the string according to the number of occurrences of each char in the string. For example, "aabcccaa" is compressed as "a2b1c3a2". If the string after the compression is not shorter, return the original string. 阅读全文
摘要:
Write a method to replace all spaces in a string with ‘%20’. 阅读全文
摘要:
Write a method to decide if two strings are anagrams or not. 阅读全文
摘要:
Write code to reverse a C-Style String. (C-String means that “abcd” is represented as five characters, including the null character.) 阅读全文
摘要:
Implement an algorithm to determine if a string has all unique characters. What if you can not use additional data structures? 阅读全文
摘要:
Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig... 阅读全文
摘要:
Given a binary tree, flatten it to a linked list in-place. 阅读全文
摘要:
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. 阅读全文
摘要:
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. 阅读全文