上一页 1 2 3 4 5 6 ··· 20 下一页
摘要: Problem:Given two strings S and T, determine if they are both one edit distance apart.General Analysis:This problem is not hard. However, to write out... 阅读全文
posted @ 2015-09-17 08:58 airforce 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Problem:Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome y... 阅读全文
posted @ 2015-09-17 01:27 airforce 阅读(349) 评论(0) 推荐(0) 编辑
摘要: Problem:Suppose you are at a party withnpeople (labeled from0ton - 1) and among them, there may exist one celebrity. The definition of a celebrity is ... 阅读全文
posted @ 2015-09-16 03:32 airforce 阅读(807) 评论(0) 推荐(0) 编辑
摘要: Problem:The API:int read4(char *buf)reads 4 characters at a time from a file.The return value is the actual number of characters read. For example, it... 阅读全文
posted @ 2015-09-15 23:54 airforce 阅读(600) 评论(0) 推荐(0) 编辑
摘要: Problem:Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, fl... 阅读全文
posted @ 2015-09-15 04:08 airforce 阅读(1168) 评论(0) 推荐(0) 编辑
摘要: Problem:A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you ... 阅读全文
posted @ 2015-09-15 00:28 airforce 阅读(583) 评论(0) 推荐(0) 编辑
摘要: Problem:Given a string, we can "shift" each of its letter to its successive letter, for example:"abc" -> "bcd". We can keep "shifting" which forms the... 阅读全文
posted @ 2015-09-14 08:13 airforce 阅读(979) 评论(0) 推荐(0) 编辑
摘要: Problem:Given a binary tree, count the number of uni-value subtrees.A Uni-value subtree means all nodes of the subtree have the same value.For example... 阅读全文
posted @ 2015-09-14 04:37 airforce 阅读(505) 评论(0) 推荐(0) 编辑
摘要: Problem:Given a strings, return all the palindromic permutations (without duplicates) of it. Return an empty list if no palindromic permutation could ... 阅读全文
posted @ 2015-09-14 02:06 airforce 阅读(698) 评论(0) 推荐(0) 编辑
摘要: Problem:Given two 1d vectors, implement an iterator to return their elements alternately.For example, given two 1d vectors:v1 = [1, 2]v2 = [3, 4, 5, 6... 阅读全文
posted @ 2015-09-14 01:18 airforce 阅读(382) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 20 下一页