2017春节回家记 返乡人潮腊月二十九请假了一天提前回家,一大早7点的高铁,提前一个小时到车站,也已经是人潮涌动了。没抢到二等座,就买了一等座,什么都无法阻挡回家的脚步。 人情世故除了家人团聚,春节最重要的非走亲戚莫属。从初二到初五,不是在亲戚家,就是在走亲戚的路上。几千年的风俗习惯,几千年的人情世故,流淌在我们心中,延绵不绝。 永恒话题蓝天白云和往年不同的是,整个市都禁放鞭炮,买卖鞭炮或者燃放鞭炮都会被严处。只有在 2月 3 2017 #随笔
LeetCode Total Hamming Distance DescriptionThe Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find the total Hamming distance between all pairs of t 1月 24 2017 #leetcode
leetcode Sum of Left Leaves DescriptionFind the sum of all left leaves in a given binary tree. Example: 1234567 3 / \ 9 20 / \ 15 7There are two left leaves in the binary tree, with values 9 and 15 respectively. 1月 23 2017 #leetcode
LeetCode Intersection of Two Arrays DescriptionGiven two arrays, write a function to compute their intersection. Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each element in the result must be unique. The resul 1月 23 2017 #leetcode
LeetCode Verify Preorder Serialization of a Binary Tree DescriptionOne way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node’s value. If it is a null node, we record using a sentinel value such 1月 23 2017 #leetcode
LeetCode Two Sum II Input array is sorted DescriptionGiven an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the tw 1月 19 2017 #leetcode
LeetCode Top K Frequent Elements DescriptionGiven a non-empty array of integers, return the k most frequent elements. For example,Given [1,1,1,2,2,3] and k = 2, return [1,2].Note: You may assume k is always valid, 1 ≤ k ≤ number of 1月 19 2017 #leetcode
LeetCode Longest Palindrome DescriptionGiven a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This is case sensitive, for example “Aa” is 1月 19 2017 #leetcode
LeetCode Battleships in a Board DescriptionGiven an 2D board, count how many different battleships are in it. The battleships are represented with ‘X’s, empty slots are represented with ‘.’s. You may assume the following rules: You 1月 19 2017 #leetcode
LeetCode Magical String DescriptionA magical string S consists of only ‘1’ and ‘2’ and obeys the following rules: The string S is magical because concatenating the number of contiguous occurrences of characters ‘1’ and ‘2’ g 1月 19 2017 #leetcode