摘要: Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] + 阅读全文
posted @ 2016-09-15 04:24 LiBlog 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. Th 阅读全文
posted @ 2016-09-15 02:46 LiBlog 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 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: Give 阅读全文
posted @ 2016-09-15 01:55 LiBlog 阅读(223) 评论(0) 推荐(0) 编辑
摘要: Given an encoded string, return it's decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is b 阅读全文
posted @ 2016-09-15 01:40 LiBlog 阅读(299) 评论(0) 推荐(0) 编辑
摘要: Numbers can be regarded as product of its factors. For example, Write a function that takes an integer n and return all possible combinations of its f 阅读全文
posted @ 2016-09-14 14:26 LiBlog 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Given s = "hello", return "holle". Example 2: Given 阅读全文
posted @ 2016-09-14 07:05 LiBlog 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 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 sequen 阅读全文
posted @ 2016-09-14 06:50 LiBlog 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: All root-to-leaf paths are: Credits:Special thanks t 阅读全文
posted @ 2016-09-14 05:51 LiBlog 阅读(136) 评论(0) 推荐(0) 编辑
摘要: You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time 阅读全文
posted @ 2016-09-14 05:41 LiBlog 阅读(218) 评论(0) 推荐(0) 编辑
摘要: Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2016-09-14 04:49 LiBlog 阅读(145) 评论(0) 推荐(0) 编辑