摘要: LeetCode——Fizz Buzz Question Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should outpu 阅读全文
posted @ 2017-04-01 21:56 清水汪汪 阅读(223) 评论(0) 推荐(1) 编辑
摘要: LeetCode——Keyboard Row Question Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyb 阅读全文
posted @ 2017-04-01 21:40 清水汪汪 阅读(193) 评论(0) 推荐(1) 编辑
摘要: LeetCode——Number Complement Question Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary 阅读全文
posted @ 2017-04-01 21:20 清水汪汪 阅读(141) 评论(0) 推荐(1) 编辑
摘要: LeetCode——Hamming Distance Question The Hamming distance between two integers is the number of positions at which the corresponding bits are different 阅读全文
posted @ 2017-04-01 20:55 清水汪汪 阅读(148) 评论(0) 推荐(0) 编辑
摘要: LeetCode——Add Strings Question Given two non negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: The length 阅读全文
posted @ 2017-04-01 16:27 清水汪汪 阅读(178) 评论(0) 推荐(1) 编辑
摘要: ```C++ // 计算树的高度 int depth(TreeNode* root) { if (!root) { return 0; } else { int i = depth(root->left); int j = depth(root->right); ... 阅读全文
posted @ 2017-04-01 15:45 清水汪汪 阅读(1215) 评论(0) 推荐(1) 编辑
摘要: LeetCode——Diameter of Binary Tree Question Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary t 阅读全文
posted @ 2017-04-01 15:38 清水汪汪 阅读(150) 评论(0) 推荐(0) 编辑
摘要: LeetCode——Number of Boomerangs Question Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such 阅读全文
posted @ 2017-04-01 14:42 清水汪汪 阅读(141) 评论(0) 推荐(1) 编辑