摘要: 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) 编辑
摘要: Problem:This is afollow upofShortest Word Distance. The only difference is now you are given the list of words and your method will be calledrepeatedl... 阅读全文
posted @ 2015-09-14 00:09 airforce 阅读(179) 评论(0) 推荐(0) 编辑