
leetcode
binbigdata
这个作者很懒,什么都没留下…
展开
-
Java-罗马数字转整数
Java-罗马数字转整数Roman-to-integer题目:给定一个罗马数字,将其转换成整数。返回的结果要求在 1 到 3999 的范围内。记数方法:I - 1 V - 5 X - 10 L - 50 C - 100 D - 500 M - 1000 1.相同的数字连写、所表示的数等于这些数字相加得到的数、如:Ⅲ=3; 2.小的数字在大的数字的右边、所表示的数等于这些数字相加得到的数、 如:Ⅷ=...转载 2018-06-20 20:38:23 · 2458 阅读 · 0 评论 -
Leetcode算法题-解法转载
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.youkuaiyun.com/fuxuemingzhu/article/details/85112591作者: 负雪明烛id: fuxuemingzhu个人博客: http://fuxuemingzhu.cn/把自己刷过的所有题目做一个整理,并且用简洁的语言概括了一下思路,汇总成了一个表格。题目的排...原创 2019-01-22 21:21:50 · 689 阅读 · 0 评论 -
[LeetCode] Sum of Two Integers 两数之和
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example:Given a = 1 and b = 2, return 3.Credits:Special thanks to @fujiaozhu for adding this ...转载 2019-01-22 21:19:51 · 199 阅读 · 0 评论 -
【LeetCode】Number Complement 解题报告
QuestionGiven a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.NoteThe given integer is guaranteed to fit within the r...原创 2019-01-22 21:13:47 · 180 阅读 · 0 评论 -
LeetCode笔记:693. Binary Number with Alternating Bits
LeetCode笔记:693. Binary Number with Alternating Bits Cloudox_ 关注2018.01.13 10:20 字数 468 阅读 16评论 0喜欢 0问题(Easy):Given a positive integer, check whether it has alternating bits: namely, if two ad...原创 2019-01-22 21:05:33 · 189 阅读 · 0 评论 -
【190-Reverse Bits(反转二制)】
2015年08月24日 07:15:15 derrantcm 阅读数:4198 标签: 数字二进制算法面试java 更多个人分类: LeetCode所属专栏: LeetCode版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.youkuaiyun.com/DERRANTCM/article/details/47945389【190-Reverse Bits(...原创 2019-01-22 20:34:07 · 282 阅读 · 0 评论 -
二进制、八进制、十进制、十六进制之间的转换
https://jingyan.baidu.com/article/495ba84109665338b30ede98.html原创 2018-10-16 21:16:08 · 187 阅读 · 1 评论 -
TensorFlow目录结构。
TensorFlow目录结构。ACKNOWLEDGMENTS #TensorFlow版本声明ADOPTERS.md #使用TensorFlow的人员或组织列表AUTHORS #TensorFlow作者的官方列表BUILDCONTRIBUTING.md #TensorFlow贡献指导ISSUE_TEMPLATE.md #提ISSUE的模板LICENSE #版权许可README.mdR...原创 2018-07-03 15:46:33 · 670 阅读 · 0 评论 -
二叉树遍历
根据层次遍历的顺序,每一层都是从左到右的遍历输出,借助于一个队列。先将根节点入队,当前节点是队头节点,将其出队并访问,如果当前节点的左节点不为空将左节点入队,如果当前节点的右节点不为空将其入队。所以出队顺序也是从左到右依次出队。代码:import java.util.LinkedList;public class LevelOrder { public void level...原创 2018-07-09 17:01:40 · 269 阅读 · 0 评论 -
题目 给定一个字符串所表示的括号序列,包含以下字符: '(', ')', '{', '}', '[' and ']', 判定是否是有效的括号序列。 样例 括号必须依照 "()"顺序表示, "()[]
题目 给定一个字符串所表示的括号序列,包含以下字符: ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, 判定是否是有效的括号序列。样例 括号必须依照 “()”顺序表示, “()[]{}”是有效的括号,但 “([)]”则是无效的括号。分析 显然需要用到栈,判断两个是否相匹配,用进站出站判断比较即可作者:六尺帐篷 链接:https://www.jianshu.com...转载 2018-07-09 16:55:39 · 2304 阅读 · 0 评论 -
6. Z字形变换
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I I G...原创 2018-06-14 21:08:00 · 643 阅读 · 0 评论 -
LeetCode 初级 - 合并两个有序链表
LeetCode 初级 - 合并两个有序链表2018年05月19日 13:20:57阅读数:105合并两个有序链表将两个有序链表合并为一个新的有序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。示例:输入:1->2->4, 1->3->4输出:1->1->2->3->4->4123分析递归处理,将两个链表中的节点顺次对比,小者加...原创 2018-06-20 21:05:43 · 184 阅读 · 0 评论 -
leetcode 318. Maximum Product of Word Lengths-最长单词积|位运算
本题的妙处在于用一个 int 值就能表示26个字母,哪些字母在单词中出现过,哪些字母没有在单词中出现过。我们知道一个 int 值有32位,小写字母总共有26位,32位的 int 值足够用每一位表示26位字母是否在单词中出现。假设字母 a 可以映射为第0位,b可以映射为第1位,...,z 可以映射为第25位,那么假设对于 int 为5的数字,在二进制中第0位和第2位为1,其他位都为0,这就代表...原创 2019-01-22 21:29:06 · 232 阅读 · 0 评论