LeetCode Implement Trie Prefix Tree DescriptionImplement a trie with insert, search, and startsWith methods. Note:You may assume that all inputs are consist of lowercase letters a-z. The original problem is here. The original code is he 10月 19 2015 #leetcode
LeetCode Bitwise AND of Numbers Range DescriptionGiven a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the range [5, 7], you should return 4. The 10月 19 2015 #leetcode
LeetCode Contains Duplicate 3 DescriptionGiven an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] and nums[j] is at most t and the difference between 10月 19 2015 #leetcode
LeetCode Add And Search Word DescriptionDesign a data structure that supports the following two operations: void addWord(word) bool search(word) search(word) can search a literal word or a regular expression string containing on 10月 17 2015 #leetcode
LeetCode Course Schedule2 DescriptionThere are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is express 10月 9 2015 #leetcode
LeetCode Move Zeros DescriptionGiven an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements. For example, given nums = [0, 1, 0, 3, 12], after calli 9月 24 2015 #leetcode
C++中类的大小(Sizeof of Class in C++) 介绍作为面向对象的语言,C++有很多面向对象的特性。对于一个类,如果能够准确判断其占用大小,说明对面向对象有了深入的理解。sizeof是一个操作符,返回一个变量或者对象的大小。 在求职面试的过程中,很多情况下,会涉及到这个问题。所以,这里列举了不同情况下C++中类的大小,默认是在64位机器上的结果。 9月 20 2015 #C++
LeetCode Interleaving String DescriptionGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1 = “aabcc”,s2 = “dbbca”, When s3 = “aadbbcbcac”, return true.When s3 = “aadbbbaccc”, return 9月 18 2015 #leetcode
LeetCode Shortest Palindrome DescriptionGiven 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 you can find by performing this transformation. 9月 18 2015 #leetcode
LeetCode House Robber2 DescriptionNote: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. T 9月 17 2015 #leetcode