leetcode
文章平均质量分 54
彤墨
北航计算机本科在读 喵
展开
-
leetcode 1200. Minimum Absolute Difference
2019.10.18 把数组中绝对值最小的每对儿数据找出来。 最简单的思路是排序,排序后找到最小值,再遍历提取绝对值为最小值的数据。 感觉有点笨的方法,应该会有更好的方法。 https://github.com/cathyxingchang/leetcode/tree/master/code ...原创 2019-10-18 15:11:01 · 117 阅读 · 0 评论 -
leecode1217. Play with Chips
leetcode1217 挪chips的问题,虽然是个easy但是是个很有趣的问题~ 一开始有个暴力的想法,就是挨个位置挨个算一遍。 后来意识到: 奇数位置的挪到奇数,权重是0; 奇数位置的挪到偶数,权重是1; 偶数位置的挪到奇数,权重是1; 偶数位置的挪到偶数,权重是0; 最终的位置状态只有两种:奇数、偶数 于是就很简单啦~ git:htt...原创 2019-10-12 20:53:54 · 150 阅读 · 0 评论 -
leetcode_136. Single Number
题目: Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without原创 2016-09-21 20:20:34 · 266 阅读 · 0 评论 -
leecode_258(未完成提高要求)
258. Add Digits Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 3 + 8 = 11, 1 +原创 2016-09-28 16:24:06 · 360 阅读 · 0 评论