摘要: A simple combination of Implement Trie (Prefix Tree) and Word Search. If you've solved them, this problem will become easy :-)The following code is ba... 阅读全文
posted @ 2015-08-17 22:49 jianchao-li 阅读(362) 评论(0) 推荐(0) 编辑
摘要: You need to understand what a Trie is before writing the code :-) This link has a nice solution, whose code is rewritten below. 1 class TrieNode { 2 p... 阅读全文
posted @ 2015-08-17 21:24 jianchao-li 阅读(233) 评论(0) 推荐(0) 编辑
摘要: This problem is purely to test your coding ability. Just go ahead :-) 1 class Solution { 2 public: 3 string countAndSay(int n) { 4 string ... 阅读全文
posted @ 2015-08-17 17:06 jianchao-li 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Try to split all the numbers into two groups with each of the target one in different groups. Refer to this link for a nice explanation.The code is wr... 阅读全文
posted @ 2015-08-17 16:16 jianchao-li 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Problem Description:Given an array ofnintegersnumsand atarget, find the number of index tripletsi, j, kwith0 & nums, int target) { 4 sort(nums... 阅读全文
posted @ 2015-08-17 15:50 jianchao-li 阅读(5070) 评论(0) 推荐(0) 编辑
摘要: Well, no matter whether the number is happy or not, its sum-of-squared-digits sequance has a cycle. Well, do you still remember the algorithm for dete... 阅读全文
posted @ 2015-08-17 00:12 jianchao-li 阅读(177) 评论(0) 推荐(0) 编辑