摘要: Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: 阅读全文
posted @ 2014-07-03 22:50 jdflyfly 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. 阅读全文
posted @ 2014-07-03 22:19 jdflyfly 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2014-07-03 22:15 jdflyfly 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. 阅读全文
posted @ 2014-07-03 21:59 jdflyfly 阅读(139) 评论(0) 推荐(0) 编辑
摘要: ay you have an array for which the ith element is the price of a given stock on day i. 阅读全文
posted @ 2014-07-03 21:53 jdflyfly 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the maximum path sum. 阅读全文
posted @ 2014-07-03 21:42 jdflyfly 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. 阅读全文
posted @ 2014-07-03 21:30 jdflyfly 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 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? 阅读全文
posted @ 2014-07-03 21:17 jdflyfly 阅读(225) 评论(3) 推荐(0) 编辑
摘要: Given an index k, return the kth row of the Pascal's triangle. 阅读全文
posted @ 2014-07-03 21:06 jdflyfly 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Given numRows, generate the first numRows of Pascal's triangle. 阅读全文
posted @ 2014-07-03 21:01 jdflyfly 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2014-07-03 20:55 jdflyfly 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2014-07-03 09:56 jdflyfly 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Write a method to replace all spaces in a string with ‘%20’. 阅读全文
posted @ 2014-07-03 09:37 jdflyfly 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Write a method to decide if two strings are anagrams or not. 阅读全文
posted @ 2014-07-03 09:34 jdflyfly 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Write code to reverse a C-Style String. (C-String means that “abcd” is represented as five characters, including the null character.) 阅读全文
posted @ 2014-07-03 09:31 jdflyfly 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Implement an algorithm to determine if a string has all unique characters. What if you can not use additional data structures? 阅读全文
posted @ 2014-07-03 09:29 jdflyfly 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2014-07-03 00:32 jdflyfly 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, flatten it to a linked list in-place. 阅读全文
posted @ 2014-07-03 00:09 jdflyfly 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. 阅读全文
posted @ 2014-07-03 00:03 jdflyfly 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2014-07-03 00:00 jdflyfly 阅读(204) 评论(0) 推荐(0) 编辑