leetcode学习笔记
文章平均质量分 65
螺旋走位猫
这个作者很懒,什么都没留下…
展开
-
(leetcode)位运算 Number Complement
题目是实现将一个int 型数转化,转化方式如下:如 5 是 101 翻转后是 010 也就是2如 8 是 1000 翻转后是 0111 也就是7实现方法一:int findComplement(int num) { unsigned mask=~0; while(mask&num) mask return原创 2017-05-10 22:50:42 · 233 阅读 · 0 评论 -
(leetcode) Keyboard Row
Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. take your keyboard as an example You may us原创 2017-05-11 15:06:23 · 265 阅读 · 0 评论 -
利用python and or,if else 简化代码
原题是这样的链接:https://leetcode.com/problems/merge-two-binary-trees/#/descriptionGiven two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are原创 2017-07-01 18:56:24 · 2168 阅读 · 0 评论 -
(leetcode)Path Sum III 挺有意思的一题
原题地址 https://leetcode.com/problems/path-sum-iii/#/descriptionYou are given a binary tree in which each node contains an integer value.Find the number of paths that sum to a given value.T原创 2017-07-04 21:01:18 · 211 阅读 · 0 评论